function popup(c,a,b){var d=window.open(c,a,b);d.focus()}function open_birdseye(a){document.getElementById("frameBirdsEye").src=a;display("divBirdsEye")}function open_detail(a){popup(a,"ListingDetail","width=820,height=750,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes")}function open_save(a){popup(a,"SaveSearch","width=620,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes")}function open_other(a){popup(a,"SaveSearch","width=650,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes")}function open_report(a){popup(a,"Report","width=820,height=650,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes")}function open_small(a){popup(a,"SaveSearch","width=650,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no")}function close_birdseye(){hide("divBirdsEye");document.getElementById("frameBirdsEye").src=""}function IsNumeric(a){var b="0123456789.,$ ";var d=true;var c;for(i=0;i<a.length&&d==true;i++){c=a.charAt(i);if(b.indexOf(c)==-1){d=false}}return d}function display(a){if(document.getElementById(a)){document.getElementById(a).style.display=""}}function hide(a){if(document.getElementById(a)){document.getElementById(a).style.display="none"}}function GetTxtValue(a){if(document.getElementById(a)){return document.getElementById(a).value}else{return""}}function SetTxtValue(a,b){if(document.getElementById(a)){document.getElementById(a).value=b}}function CommaFormatted(c){var j=",";var f=c.split(".",2);var g=f[1];var b=parseInt(f[0]);if(isNaN(b)){return""}var h="";if(b<0){h="-"}b=Math.abs(b);var e=new String(b);var f=[];while(e.length>3){var k=e.substr(e.length-3);f.unshift(k);e=e.substr(0,e.length-3)}if(e.length>0){f.unshift(e)}e=f.join(j);c=e;c=h+c;return c}function getAlphabet(b){var a=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");return a[b]}function SetCookie(a,e,d){if(d){var b=new Date();b.setTime(b.getTime()+(d*24*60*60*1000));var c="; expires="+b.toGMTString()}else{var c=""}document.cookie=a+"="+e+c+"; path=/"}function GetCookie(a){var f=a+"=";var b=document.cookie.split(";");for(var e=0;e<b.length;e++){var d=b[e];while(d.charAt(0)==" "){d=d.substring(1,d.length)}if(d.indexOf(f)==0){return d.substring(f.length,d.length)}}return null}function ClearCookie(a){SetCookie(a,"",-1)}function FieldHelpText(b,a){if(b.defaultValue==b.value){b.value="";if(a=="1"){b.className="inputW"}else{b.className="txt_blk"}}else{if(b.value==""){b.value=b.defaultValue;if(a=="1"){b.className="inputW_gray"}else{b.className="txt_gray"}}}}function toggleById(a){if(document.getElementById(a)){if(document.getElementById(a).style.display==""){document.getElementById(a).style.display="none"}else{document.getElementById(a).style.display=""}}}function isHidden(a){if(document.getElementById(a)){if(document.getElementById(a).style.display=="none"){return true}else{return false}}else{return true}}function addOption(c,a){try{c.add(a,null)}catch(b){c.add(a)}}function showToolTip(f,g){if(document.all){f=event}var a=document.getElementById("bubble_tooltip");var b=document.getElementById("bubble_tooltip_content");b.innerHTML=g;a.style.display="block";var d=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(navigator.userAgent.toLowerCase().indexOf("safari")>=0){d=0}var c=f.clientX-100;if(c<0){c=0}a.style.left=c+"px";a.style.top=f.clientY-a.offsetHeight-1+d+"px"}function hideToolTip(){document.getElementById("bubble_tooltip").style.display="none"}function $A(c){if(!c){return[]}if(c.toArray){return c.toArray()}var a=c.length||0,b=new Array(a);while(a--){b[a]=c[a]}return b}Function.prototype.bind=function(){if(arguments.length<2&&typeof arguments[0]=="undefined"){return this}var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}};Function.prototype.bindAsEventListener=function(){var a=this,c=$A(arguments),b=c.shift();return function(d){return a.apply(b,[d||window.event].concat(c))}};function stripCharsInBag(a,d){var f;var b="";for(f=0;f<a.length;f++){var e=a.charAt(f);if(d.indexOf(e)==-1){b+=e}}return b}function stripCharsNotInBag(a,d){var f;var b="";for(f=0;f<a.length;f++){var e=a.charAt(f);if(d.indexOf(e)!=-1){if(e=="."){break}else{b+=e}}}return b}function checkInt(a){return(!isNaN(a))}function checkIntMaxValue(a){a=stripCharsNotInBag(a,"1234567890.");if(a>2147483647){return 2147483647}return a}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.ltrim=function(){return this.replace(/^\s+/,"")};String.prototype.rtrim=function(){return this.replace(/\s+$/,"")};function resizeIFrame(c,b){try{if(c){if(c.contentDocument){var a=c.contentDocument.body.scrollHeight;if(b!=undefined){a=a+b}c.height=a}else{var a=c.contentWindow.document.body.scrollHeight;if(b!=undefined){a=a+b}c.style.height=a}}}catch(d){}}function resizeIFrameH(b,a){try{if(b){if(b.contentDocument){b.height=a}else{b.style.height=a}}}catch(c){}}function resizeIFrameW(a,b){try{if(a){if(a.contentDocument){a.height=a.contentDocument.body.scrollHeight;a.width=b}else{a.style.height=a.contentWindow.document.body.scrollHeight;a.style.width=b}}}catch(c){}}function resizeIFrameWH(b,c,a){try{if(b){if(b.contentDocument){b.height=a;if(c>750){b.width=c}}else{b.style.height=a;if(c>750){b.style.width=c}}}}catch(d){}};map={};var globNELat="NELat";var globNELong="NELong";var globSWLat="SWLat";var globSWLong="SWLong";var globZoom="Zoom";var veMap;var midLat;var midLong;var zoom;var view;var polyPoints;var startAddress;var isStatic;var supportBirdsEye;var newMapWidth;var newMapHeight;var isProcessing=false;var cachedCoordinates=new Array();var submitForm=1;var parecelSet=0;var companyID;var bestview=false;var activeView="map";var MapUIImagePath="/Map/images/";var isLoaded=false;map.browserNotSupported=function(){document.getElementById("divMap").style.visibility="hidden";document.getElementById("MapNotSupported").style.display="block"};map.initMap=function(){browserDetect.firefox2Fix();if(resizeMapWidthDiff>0){document.getElementById("divMap").style.width=map.getMapWidth()+"px"}if(resizeMapHeightDiff>0){document.getElementById("divMap").style.height=map.getMapHeight()+"px"}map.renderMap()};map.renderMap=function(){try{veMap=new VEMap("divMap");veMap.LoadMap(new VELatLong(parseFloat(midLat),parseFloat(midLong)),zoom,view,isStatic,VEMapMode.Mode2D,false)}catch(a){browserDetect.browserNotSupported()}if(isStatic==1){document.getElementById("divMap").childNodes[0].style.cursor="default";window.onresize=null}else{map.ShowMiniMap(0,mapHeight-150);try{if(polyPoints!=""){Shape.DrawPolygon(polyPoints)}}catch(a){}map.resizeMap();if(map.isPOIEnabled()){POI.displayPOI()}map.toggleParcelLines()}veMap.SetMouseWheelZoomToCenter(false);veMap.SetMapStyle(VEMapStyle.Shaded);veMap.AttachEvent("onendcontinuouspan",map.onEndPan);veMap.AttachEvent("onendpan",map.onEndPan);veMap.AttachEvent("onendzoom",map.onEndZoom);veMap.AttachEvent("onchangemapstyle",map.onChangeMapStyle);map.HideMiniMap();if(typeof _allAutoSuggests!="undefined"){veMap.AttachEvent("onmousedown",function(){for(var c=0,b=_allAutoSuggests.length;c<b;c++){_allAutoSuggests[c].hideDiv()}})}if(!supportBirdsEye){hide("MSVE_navAction_ObliqueMapView")}if(startAddress!=""){map.GotoFirst(startAddress);self.setTimeout("map.setLatLongValues();",800)}if(view!=""){if(view=="b"){veMap.SetZoomLevel(zoom)}self.setTimeout("map.setView(view);",1500)}isLoaded=true};map.onEndPan=function(a){map.setLatLongValues();if(map.isPOIEnabled()){POI.displayPOI()}};map.onEndZoom=function(a){map.setLatLongValues();if(map.isPOIEnabled()){POI.displayPOI()}map.toggleParcelLines()};map.onChangeMapStyle=function(a){if(veMap.GetMapStyle()==VEMapStyle.Road){map.setView("r")}};map.Expand=function(){map.resizeMapHeight(mapHeightFixed+200);hide("map_expand");display("map_shrink");SetCookie("MapSearch_MapExpanded","1",10)};map.Shrink=function(){map.resizeMapHeight(mapHeightFixed);display("map_expand");hide("map_shrink");SetCookie("MapSearch_MapExpanded","0",10)};window.onresize=function(){map.resizeMap()};map.resizeMapWidth=function(a){resizeMapWidthDiff=a;map.resizeMap()};map.resizeMapHeight=function(a){mapHeight=a;map.resizeMap()};map.resizeMap=function(){var d=newMapWidth;var a=newMapHeight;newMapWidth=mapWidth;newMapHeight=mapHeight;if(veMap&&(resizeMapWidthDiff>0||resizeMapHeightDiff>0)){var c=veMap.vemapcontrol.GetCenterLatitude();var b=veMap.vemapcontrol.GetCenterLongitude();if(resizeMapWidthDiff>0){newMapWidth=map.getMapWidth()}if(resizeMapHeightDiff>0){newMapHeight=map.getMapHeight()}if((d!=newMapWidth&&(newMapWidth>d+20||newMapWidth<d-20))||a!=newMapHeight){veMap.vemapcontrol.Resize(newMapWidth,newMapHeight);if(d==undefined||(newMapWidth>d+40||newMapWidth<d-40)){}else{submitForm=0}if(a!=newMapHeight){map.ShowMiniMap(0,newMapHeight-150);map.HideMiniMap()}if(document.getElementById("tblProcessing")){document.getElementById("tblProcessing").style.width=newMapWidth+"px";if(map.isPOIEnabled()){document.getElementById("tblProcessing").style.height=newMapHeight+28+"px"}else{document.getElementById("tblProcessing").style.height=newMapHeight+"px"}}if(document.getElementById("divBirdsEye")){document.getElementById("divBirdsEye").style.left=(newMapWidth-465)/2+"px"}if(document.getElementById("mapsearch-advisory-box")){$("#mapsearch-advisory-box").animate({top:(newMapHeight+25)+"px",left:(newMapWidth+10)/2+"px"},"slow","swing")}if(document.getElementById("divSelectLocation")){document.getElementById("divSelectLocation").style.left=(newMapWidth-300)/2+"px"}if(document.getElementById("MapWidth")){document.getElementById("MapWidth").value=newMapWidth}if(document.getElementById("mapsearch-right")){document.getElementById("mapsearch-right").style.width=newMapWidth+9+"px"}if(activeView=="gallery"){self.setTimeout("resizeIFrameW(document.getElementById('SearchResultsFrame'), '100%')",800)}}}};map.getMapWidth=function(){var a;if(self.clientWidth){a=self.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){a=document.documentElement.clientWidth}else{if(document.body){a=document.body.clientWidth}}}a=a-resizeMapWidthDiff;if(a<mapWidth){a=mapWidth}return a};map.getMapHeight=function(){var a;if(self.clientHeight){a=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{if(document.body){a=document.body.clientHeight}}}a=a-resizeMapHeightDiff;if(a<mapHeight){a=mapHeight}return a};map.moveDashboard=function(a){if(document.getElementById("MSVE_navAction_container")){document.getElementById("MSVE_navAction_container").style.position="relative";document.getElementById("MSVE_navAction_container").style.left=a+"px"}};map.getZoomLevel=function(){return veMap.GetZoomLevel()};map.PanToLatLong=function(c,a,b){submitForm=b;veMap.vemapcontrol.PanToLatLong(c,a)};map.moveMap=function(d,a,c,b){var e=new VELatLong(d,a);veMap.SetCenterAndZoom(e,c);submitForm=b};map.setLatLongValues=function(){if(veMap){var b=document.getElementById("divMap");var a=veMap.GetZoomLevel();ne_LatLong=veMap.PixelToLatLong(new VEPixel(b.offsetWidth,0));sw_LatLong=veMap.PixelToLatLong(new VEPixel(0,b.offsetHeight));if(document.getElementById(globNELat)){document.getElementById(globNELat).value=ne_LatLong.Latitude}if(document.getElementById(globNELong)){document.getElementById(globNELong).value=ne_LatLong.Longitude}if(document.getElementById(globSWLat)){document.getElementById(globSWLat).value=sw_LatLong.Latitude}if(document.getElementById(globSWLong)){document.getElementById(globSWLong).value=sw_LatLong.Longitude}if(document.getElementById(globZoom)){document.getElementById(globZoom).value=a}if(activeView!="map"){submitForm=0}if(submitForm!=0){map.submitSearch()}submitForm=1}};map.submitSearch=function(){if(document.getElementById("searchCriteria")&&veMap.GetMapStyle()!=VEMapStyle.Birdseye&&document.getElementById("draw_cancel").style.display=="none"){Search.submit()}};map.setView=function(a){switch(a){case"r":veMap.SetMapStyle(VEMapStyle.Shaded);break;case"s":veMap.SetMapStyle(VEMapStyle.Shaded);break;case"h":veMap.SetMapStyle(VEMapStyle.Hybrid);break;case"a":veMap.SetMapStyle(VEMapStyle.Aerial);break;case"b":if(veMap.IsBirdseyeAvailable()){veMap.SetMapStyle(VEMapStyle.Birdseye);veMap.SetZoomLevel(2)}else{veMap.SetMapStyle(VEMapStyle.Hybrid)}break}};map.toggleProcessing=function(a){if(a==1){isProcessing=true;document.getElementById("divProcessing").style.visibility="visible"}else{isProcessing=false;document.getElementById("divProcessing").style.visibility="hidden"}};map.cacheArea=function(){var d=document.getElementById("NELat").value;var b=document.getElementById("NELong").value;var a=document.getElementById("SWLat").value;var c=document.getElementById("SWLong").value;cachedCoordinates[0]=d;cachedCoordinates[1]=b;cachedCoordinates[2]=a;cachedCoordinates[3]=c};map.isInCachedArea=function(){var d=document.getElementById("NELat").value;var b=document.getElementById("NELong").value;var a=document.getElementById("SWLat").value;var c=document.getElementById("SWLong").value;if(d<=parseFloat(cachedCoordinates[0])&&d>=parseFloat(cachedCoordinates[2])&&b<=parseFloat(cachedCoordinates[1])&&b>=parseFloat(cachedCoordinates[3])&&a<=parseFloat(cachedCoordinates[0])&&a>=parseFloat(cachedCoordinates[2])&&c<=parseFloat(cachedCoordinates[1])&&c>=parseFloat(cachedCoordinates[3])){return true}else{return false}};map.Find=function(a){veMap.Find(null,a,null,null,null,null,null,null,false,false,FindCallback)};map.SmartFind=function(a){if(a!=""&&a!="undefined"){if(a.indexOf(",")>-1&&a.substring(a.indexOf(","),a.length).length>2){map.Goto(a+",usa")}else{map.Find(a+",usa")}}};map.GotoFirst=function(b,a){if(b!=""&&b!="undefined"){veMap.Find(null,b,VEFindType.Businesses,null,null,null,null,null,true,true,null)}if(a==1){self.setTimeout("veMap.SetZoomLevel(map.getZoomLevel() + 2)",500)}self.setTimeout("map.setLatLongValues()",500)};map.Goto=function(a){if(a!=""&&a!="undefined"){hide("divSelectLocation");SetCorrectCityValue(a);map.GotoFirst(a)}};map.GotoAndFlag=function(a){pushpin.deletePin("1_999");map.GotoFirst(a,1);if(a.length>0){self.setTimeout("pushpin.addPin('1_999', veMap.vemapcontrol.GetCenterLatitude(), veMap.vemapcontrol.GetCenterLongitude(), 34, '', '"+a+"');",1000)}};map.ShowTraffic=function(){map.LoadTraffic(true);map.ShowTrafficLegend(50,50);map.SetTrafficLegendText("Traffic")};map.ClearTraffic=function(){map.ClearTraffic()};function SetCorrectCityValue(a){if(document.getElementById("SearchType")&&document.getElementById("SearchType").value==1&&document.getElementById("Search_SearchCriteria_City")&&document.getElementById("Search_SearchCriteria_City").value!=""){if(a.indexOf(",")>-1){a=a.substring(0,a.indexOf(","))}if(a.indexOf("(")>-1){a=a.substring(0,a.indexOf("("))}document.getElementById("Search_SearchCriteria_City").value=a}}function FindCallback(a,b,e,d,f){var c="";if(e.length>1){for(i=0;i<e.length;i++){c+="<a href=\"javascript:map.Goto('"+e[i].Name+"')\">"+e[i].Name+"</a><br/><br/>"}display("divSelectLocation");document.getElementById("divSelectLocationList").innerHTML=c}else{map.Goto(e[0].Name)}}map.toggleParcelLines=function(){if(veMap){try{if(map.getZoomLevel()>=16&&veMap.GetMapStyle()!=VEMapStyle.Birdseye){if(parecelSet==0){if(typeof(veMap.parcelLayer)=="undefined"){AddDMPParcelLayer(veMap)}else{SetParcelLayerVisibility(veMap,true)}parecelSet=1}}else{parecelSet=0;SetParcelLayerVisibility(veMap,false)}if(map.getZoomLevel()>=17||veMap.GetMapStyle()==VEMapStyle.Birdseye){display("MSVE_navAction_ObliqueMapView")}else{hide("MSVE_navAction_ObliqueMapView")}}catch(a){}}};map.ShowMiniMap=function(){map.ShowMiniMap(0,map.getMapHeight-150)};map.ShowMiniMap=function(a,b){if(veMap&&view!="b"){veMap.ShowMiniMap(a,b);if(b!="undefined"&&b>0&&document.getElementById("divMiniMapToggle")){document.getElementById("divMiniMapToggle").style.top=b+136}hide("MSVE_minimap_resize");hide("minimap_show");display("minimap_hide")}else{hide("minimap_show");hide("minimap_hide")}};map.HideMiniMap=function(){if(veMap){veMap.HideMiniMap();display("minimap_show");hide("minimap_hide")}};map.isPOIEnabled=function(){if(document.getElementById("mapPOIControl")){return true}else{return false}};map.toggleMapControl=function(){if(document.getElementById("MSVE_lowerContainer")){if(document.getElementById("MSVE_lowerContainer").style.visibility=="hidden"){document.getElementById("MSVE_lowerContainer").style.visibility="visible";document.getElementById("MSVE_navAction_header").innerHTML="<div id=toggleDashboard><a>Hide</a></div>"}else{document.getElementById("MSVE_lowerContainer").style.visibility="hidden";document.getElementById("MSVE_navAction_header").innerHTML="<div id=toggleDashboard><a>Show</a></div>"}}};var arrayLocations;map.GetDirections=function(b){arrayLocations=b;map.toggleProcessing(1);var a=new VERouteOptions();a.RouteCallback=onGotRoute;if(document.getElementById("divRoute")){a.SetBestMapView=false}a.ShowDisambiguation=true;a.DistanceUnit=VERouteDistanceUnit.Mile;if(veMap){veMap.GetDirections(b,a)}else{self.setTimeout("veMap.GetDirections(arrLocations, options);",1000)}};function onGotRoute(d){var f=document.getElementById("divRoute");var g=document.getElementById("divPrintRoute");var l="";var k=d.RouteLegs;var h=0;if(g){l+='<table width="100%" border="0" cellspacing="2" cellpadding="2" class="dd_txt">'}else{l+='<table width="175" border="0" cellspacing="2" cellpadding="2" class="dd_txt">'}l+='<tr><td colspan="4" class="dd_tableHeader1">';l+="Total Distance: "+d.Distance.toFixed(1)+" miles";l+="<br/>Total Time: "+GetTime(d.Time)+"</td></tr>";for(var a=0;a<k.length;a++){var e=k[a];var m=null;var c=a+1;if(g){l+='<tr><td colspan="4" class="dd_tableHeader2" nowrap="nowrap"><b>From: </b>'+GetLocationFromArray(a)+"<br/><b>To: </b>"+GetLocationFromArray(a+1)+"<br/><b>Time: </b>"+GetTime(e.Time)+"</td></tr>"}else{l+='<tr><td colspan="4" class="dd_tableHeader2" nowrap="nowrap"><b>From: </b>'+GetLocationFromArray(a).substring(0,20)+"...<br/><b>To: </b>"+GetLocationFromArray(a+1).substring(0,22)+"...<br/><b>Time: </b>"+GetTime(e.Time)+"</tr><td>"}for(var b=0;b<e.Itinerary.Items.length;b++){m=e.Itinerary.Items[b];l+="<tr>";if(a==0&&b==0){l+='<td align="center" class="hseparator"><img src="/Map/Images/DrivingDirection/pin_Start.gif"/></td>'}else{if(a==k.length-1&&b==e.Itinerary.Items.length-1){l+='<td align="center" class="hseparator"><img src="/Map/Images/DrivingDirection/pin_End.gif"/></td>'}else{l+='<td align="center" class="hseparator"><div class="dd_number">'+h+"</div></td>"}}l+='<td class="hseparator">'+m.Text+"</td>";l+='<td class="hseparator">';if(m.Distance!=null){l+=m.Distance.toFixed(1)}l+="</td></tr>";h++}}l+="</table>";if(DrivingDirection){DrivingDirection.SetDirections(l)}map.toggleProcessing(0)}function GetTime(e){if(e==null){return("")}if(e>60){var b=e%60;var d=e-b;d=d/60;if(d>60){var a=d%60;var c=d-a;c=c/60;return(c+" hrs, "+a+" mins, "+b+" secs")}else{return(d+" mins, "+b+" secs")}}else{return(e+" secs")}}function GetLocationFromArray(a){return arrayLocations[a]}map.plotComps=function(f){var e=f.split(":");var a=e.length;for(var c=0;c<a;c++){if(e[c]==""){continue}var b=e[c].split(",");var d=b[0];var g=b[1];if(d!=""&&g!=""&&d!="undefined"&&g!="undefined"){pushpin.addPin("comp_"+c,d,g,"listing_"+(c+1),"","")}}};map.populateNeighborhoods=function(f,a,c,d,b){var g=document.getElementById("divNeighborhood");if(!g){return}var e=document.getElementById("Neighborhood");if(map.getZoomLevel()>=10&&veMap.GetMapStyle()!=VEMapStyle.Birdseye){message.displayLoading("NeighborhoodLoading",12);e.style.display="none";message.setInnerHTML("divNeighborhoodInfo","Retrieving Neighborhoods in this Area");GetNeighborhoods("nelat="+f+"&nelon="+a+"&swlat="+c+"&swlon="+d+"&zoom="+b,e)}else{e.style.display="none";message.setInnerHTML("divNeighborhoodInfo","Zoom in to view Neighborhoods");message.setTitle("icNeighborhoodInfo","Zoom in to view Neighborhoods")}};var xmlhttp_n;function GetNeighborhoods(a,c){xmlhttp_n=null;if(a=="undefined"||a==""){return}var b="/Map/AJAX/GetBoundary.aspx?neighborhoods=1&cid="+companyID+"&"+a;xmlhttp_n=ajax.GetXmlHttpObject();xmlhttp_n.open("GET",b,true);xmlhttp_n.onreadystatechange=function(){if(xmlhttp_n.readyState!=4||xmlhttp_n.status!=200){return}try{var f=xmlhttp_n.responseText;if(!c){return}c.length=0;if(f=="undefined"||f.length<=0){c.style.display="none";message.setInnerHTML("divNeighborhoodInfo","No Neighborhood Found");message.setTitle("icNeighborhoodInfo","No Neighborhood Found");return}var g=f.split(";");var l=g.length;var m=document.getElementById("selNeighborhood").value;if(l>0){message.setTitle("icNeighborhoodInfo","The list below shows all neighborhoods in the nearby map area. Select a neighborhood to see it outlined on the map or zoom out the map to see more neighborhoods.");addOption(c,new Option("- Select Neighborhood -",""));for(var d=0;d<l;d++){var h=g[d].split(":");var j=document.createElement("option");j.text=h[1];j.value=h[0];if(h[0]==m){j.selected="selected"}addOption(c,j)}hide("divNeighborhoodInfo");c.style.display=""}}catch(k){c.style.display="none";message.setInnerHTML("divNeighborhoodInfo",k.message)}finally{message.hideLoading("NeighborhoodLoading");xmlhttp_n=null}};xmlhttp_n.send(null)};pushpin={};var pin1=new Array();var pin2=new Array();var pin5=new Array();var pin6=new Array();var pin7=new Array();var pin8=new Array();var pin9=new Array();var pin10=new Array();var pin11=new Array();var pin12=new Array();var pin13=new Array();var pin14=new Array();var pin15=new Array();var pin16=new Array();var pin17=new Array();var pin18=new Array();var pin19=new Array();var pin20=new Array();var pin21=new Array();var listingLat;var listingLong;var listingAddress;var listingAddressLat;var listingAddressLong;var ListingLayer=null;var listingShapes=[];var listingShapesHash=[];var collisionPins="";var collisionPinIconId=4;pushpin.SetCollisionPinIconId=function(a){collisionPinIconId=a};pushpin.GetTotalListingShapes=function(){var a=0;if(listingShapes!=null){a=listingShapes.length}return a};pushpin.GetShapeByPinID=function(b){var a=null;var d=null;try{d=GetLayer("LISTING");if(d&&d!=null){for(i=0;i<d.GetShapeCount();i++){a=d.GetShapeByIndex(i);if(a.PinID==b){break}}}}catch(c){}return a};function GetShapeByPinID(b){var a=null;var c=GetLayer("LISTING");for(i=0;i<c.GetShapeCount();i++){a=c.GetShapeByIndex(i);if(a.PinID==b){break}}return a}function GetShapeFromArrayByPinID(c){var b=null;var a;if(c.indexOf("3_")>-1){a=officeShapes}else{a=listingShapes}for(i=0;i<a.length;i++){b=a[i];if(b.PinID==c){break}else{b=null}}return b}pushpin.commitListingPins=function(){var b=document.getElementById("chkIconToggle");if(b&&b.checked){addCollisionShapes();var a=GetLayer("LISTING");a.AddShape(listingShapes);if(bestview){veMap.SetMapView(listingShapes)}bestview=false}};pushpin.addListingPin2=function(f,b,c,a,e,g){var d=new VEShape(VEShapeType.Pushpin,new VELatLong(parseFloat(b),parseFloat(c)));if(e&&e.length>0){d.SetTitle(e)}if(g&&g.length>0){d.SetDescription(g)}d.SetCustomIcon(MapUIImagePath+pushpin.getPinImgUrl(a));d.PinID=f;listingShapesHash[b+"|"+c]=d;listingShapes.push(d)};pushpin.addListingPinToMap=function(e,b,c,a,d,g){var f=checkForListingPinCollision(b,c,d);if(f!=null){pushpin.addListingPin2(e,b,c,a,d,g);if(collisionPins.indexOf(":"+b+":"+c+"]")>-1){collisionPins=collisionPins.replace(":"+b+":"+c+"]",","+e+":"+b+":"+c+"]")}else{collisionPins+="["+f.PinID+","+e+":"+b+":"+c+"]"}}else{pushpin.addListingPin2(e,b,c,a,d,g)}};pushpin.deleteListingPinsFromMap=function(){var a=GetLayer("LISTING");if(a){a.DeleteAllShapes();listingShapes=[];listingShapesHash=[];collisionPins=""}};function checkForListingPinCollision(a,c,b){return listingShapesHash[a+"|"+c]}function addCollisionShapes(){var f=collisionPins.split("[");for(var a=0;a<f.length;a++){if(f[a]!=""){var b=f[a].replace("]","").split(":");var h=b[1];var g=b[2];var d=b[0].split(",");var c="";for(var k=0;k<d.length;k++){c+="<table width=100% valign=top cellspacing=1 cellpadding=1 class=txt_blk ";if(k>0){c+='style="display:none;"'}c+=" id=pin_"+k+">";c+=getToggleBubbleHtml(d.length,k,"Properties");var e=GetShapeFromArrayByPinID(d[k]);if(e!=null){c+="<tr><td>"+e.GetDescription()+"</td></tr>"}c+="</table>"}pushpin.addListingPin2(d,h,g,collisionPinIconId,"Listing",c)}}}function getListingPinCollisionHtml(b){if(b==undefined){return}var a="";var e=b.split(",");for(var d=0;d<e.length;d++){a+="<table width=100% valign=top cellspacing=1 cellpadding=1 class=txt_blk ";if(d>0){a+='style="display:none;"'}a+=" id=pin_"+d+">";a+=getToggleBubbleHtml(e.length,d,"Points of Interest");var c=GetShapeFromArrayByPinID(e[d]);if(c!=null){a+="<tr><td>"+c.GetDescription()+"</td></tr>"}a+="</table>"}return a}function GetLayer(a){if(veMap){if(a=="POI"){if(POILayer==null){POILayer=new VEShapeLayer();veMap.AddShapeLayer(POILayer)}return POILayer}else{if(a=="LISTING"){if(ListingLayer==null){if(OfficeLayer==null&&!isHidden("office_on")){OfficeLayer=new VEShapeLayer();veMap.AddShapeLayer(OfficeLayer)}ListingLayer=new VEShapeLayer();veMap.AddShapeLayer(ListingLayer)}return ListingLayer}else{if(a=="OFFICE"){if(OfficeLayer==null){OfficeLayer=new VEShapeLayer();veMap.AddShapeLayer(OfficeLayer)}return OfficeLayer}}}}}pushpin.deleteLayer=function(b){var a;a=GetLayer(b);if(a!=null){veMap.DeleteShapeLayer(a);a=null}};pushpin.addPin=function(a,d,j,b,k,c){if(veMap){try{var h=pushpin.getPinImgUrl(b);var g=new VEPushpin(a,new VELatLong(parseFloat(d),parseFloat(j)),MapUIImagePath+h,k,c);veMap.AddPushpin(g)}catch(f){}}};pushpin.addListingPin=function(a,c,h,b,j,g){if(veMap){var f=new VEPushpin(a,new VELatLong(parseFloat(c),parseFloat(h)),b,j,g);try{veMap.AddPushpin(f)}catch(d){}}};pushpin.AddLocationPin=function(a){veMap.Find(null,a,null,null,1,null,true,null,null,null,null)};pushpin.AddListings=function(){var c;var a;if(listingLat!=""){c=listingLat.split(",");a=listingLong.split(",");for(i=0;i<c.length;i++){var b="";if(listingAddress!=""){b="<table><tr><td>"+listingAddress.replace("!!","<br/>")+"</td></tr></table>"}if(i==0){pushpin.addPin("1_"+i,c[i],a[i],1,"",b)}else{pushpin.addPin("1_"+i,c[i],a[i],2,"",b)}}}else{if(listingAddress!=""){if(listingAddressLat==null){FindLocation()}else{var b="<table><tr><td>"+listingAddress.replace(",",", ")+"</td></tr></table>";pushpin.addPin("1_1",listingAddressLat,listingAddressLong,2,"",b)}}}};function FindLocation(){var a=veMap.Find(null,listingAddress,null,null,1,null,null,null,null,null,OnFoundResults)}function OnFoundResults(d,a,b,c){var e="<table><tr><td>"+listingAddress.replace(/,/,", ")+"</td></tr></table>";listingAddressLat=b[0].LatLong.Latitude;listingAddressLong=b[0].LatLong.Longitude;pushpin.addPin("1_1",listingAddressLat,listingAddressLong,2,"",e)}function GetLayer(a){if(a=="POI"){if(POILayer==null){POILayer=new VEShapeLayer();veMap.AddShapeLayer(POILayer)}return POILayer}else{if(a=="LISTING"){if(ListingLayer==null){ListingLayer=new VEShapeLayer();veMap.AddShapeLayer(ListingLayer)}return ListingLayer}}}pushpin.deleteLayer=function(b){var a;a=GetLayer(b);if(a!=null){veMap.DeleteShapeLayer(a);a=null}};pushpin.deleteAllPins=function(){if(veMap){veMap.DeleteAllPushpins();pushpin.AddListings()}};pushpin.deletePin=function(b){if(veMap){try{veMap.DeletePushpin(b)}catch(a){}}};pushpin.addPinArrayToMap=function(a){if(a==undefined||a==""){return}var e="";var b="";var c="";if(a==pin1&&document.getElementById("chkListingToggle")&&!document.getElementById("chkListingToggle").checked){}else{for(var d=0;d<a.length;d++){addPushPinItemToMap(a[d])}}};pushpin.deletePinArrayFromMap=function(n,p){if(n==undefined){return}for(var a=0;a<n.length;a++){if(n[a]){pushpin.deletePin(n[a][0])}}var f="";if(veMap&&veMap.pushpins){for(var b=0;b<veMap.pushpins.length;b++){if(veMap.pushpins[b].ID.search(",")>-1){if(f.length>0){f+=":"}f+=veMap.pushpins[b].ID}}var h=f.split(":");for(var c=0;c<h.length;c++){var o=h[c].split(",");var d="";for(var g=0;g<o.length;g++){if(o[g].search(p+"_")==-1){if(d.length==0){d+=o[g]}else{d+=","+o[g]}}}if(h[c]!=d){pushpin.deletePin(h[c]);if(d!=""){pinsToAddBack=d.split(",");for(var e=0;e<pinsToAddBack.length;e++){addPushPinItemToMap(getArrayObjectFromID(pinsToAddBack[e]))}}}}}};pushpin.getCountByTypeID=function(typeid){var evalText="pin"+typeid+".length";return eval(evalText)};pushpin.showBubble=function(b){try{var a=GetShapeByPinID(b);if(a){veMap.ShowInfoBox(a)}}catch(c){}};pushpin.hideBubble=function(a){veMap.HideInfoBox()};function pointInPolygon(d,c,a){var b;var e=d.length-1;var f=false;for(b=0;b<d.length;b++){if(d[b].Longitude<a&&d[e].Longitude>=a||d[e].Longitude<a&&d[b].Longitude>=a){if(d[b].Latitude+(a-d[b].Longitude)/(d[e].Longitude-d[b].Longitude)*(d[e].Latitude-d[b].Latitude)<c){f=!f}}e=b}return f}function addPushPinItemToMap(d){if(d==undefined||d==""){return}var a="";var b="";var c="";c=checkForPushPinCollision(d);if(c.indexOf("1_")>-1&&d[3]!=1){return}if(c.length>0){b=c+","+d[0];a=getCollisionHtml(b);if(c.indexOf("1_")>-1){pushpin.addPin(d[0],d[1],d[2],d[3],d[4],d[5]);pushpin.addPin(b,d[1],d[2],collisionPinIconId,"",a)}else{pushpin.addPin(b,d[1],d[2],22,"",a)}}else{pushpin.addPin(d[0],d[1],d[2],d[3],d[4],d[5])}}function getArrayObjectFromID(ID){var evalText="";var parts=ID.split("_");if(parts.length!=2){return null}evalText="pin"+parts[0]+"["+parts[1]+"]";return eval(evalText)}function checkForPushPinCollision(b){if(b==undefined){return""}for(var a=veMap.pushpins.length-1;a>=0;a--){if(b[1]==veMap.pushpins[a].LatLong.Latitude&&b[2]==veMap.pushpins[a].LatLong.Longitude){return veMap.pushpins[a].ID}}return""}function getCollisionHtml(pinIDs){if(pinIDs==undefined){return}var html="";var pinIDArray=pinIDs.split(",");var arrayAndIndex;var evalText="";for(var i=0;i<pinIDArray.length;i++){arrayAndIndex=pinIDArray[i].split("_");html+="<table width=100% valign=top cellspacing=1 cellpadding=1 class=txt_blk ";if(i>0){html+='style="display:none;"'}html+=" id=pin_"+i+">";html+=getToggleBubbleHtml(pinIDArray.length,i,"Points of Interest");evalText="pin"+arrayAndIndex[0]+"["+(arrayAndIndex[1])+"][5];";html+="<tr><td>"+eval(evalText)+"</tr></td>";html+="</table>"}return html}function getToggleBubbleHtml(a,c,d){var b="";b+="<tr><td valign=top><table cellspacing=0 cellpadding=0 border=0 class=txt_blk_yellowbg width=100%>";b+="<tr><td colspan=3>Multiple "+d+" found here</td></tr>";b+="<tr><td align=left width=30%>";if(c>0){b+='<a href="javascript:togglePinBubble('+(c-1)+","+c+')"/>< Prev</a>'}b+="</td><td align=center width=40%>";b+="<b>"+(c+1)+" of "+a+"</b>";b+="</td><td align=right width=30%>";if(c<a-1){b+='<a href="javascript:togglePinBubble('+(c+1)+","+c+')"/>Next ></a>'}b+="</td></tr></table></td></tr>";return b}function togglePinBubble(c,a){var b=document.getElementById("pin_"+c);var d=document.getElementById("pin_"+a);if(b&&d){d.style.display="none";b.style.display="block"}}function getPinImgUrl(a){return pushpin.getPinImgUrl(a)}pushpin.getPinImgUrl=function(b){var a="";switch(b){case 1:a="POI/listing_active.gif";break;case 2:a="POI/listing_other.gif";break;case 3:a="POI/office.gif";break;case 4:a="POI/listing_multiple.gif";break;case 5:a="POI/childcare_on.gif";break;case 6:a="POI/schools_on.gif";break;case 7:a="POI/restaurants_on.gif";break;case 8:a="POI/shopping_on.gif";break;case 9:a="POI/grocery_on.gif";break;case 10:a="POI/gas_on.gif";break;case 11:a="POI/bank_on.gif";break;case 12:a="POI/park_on.gif";break;case 13:a="POI/hospital_on.gif";break;case 14:a="POI/transport_on.gif";break;case 15:a="POI/lodging_on.gif";break;case 16:a="POI/worship_on.gif";break;case 17:a="POI/police_on.gif";break;case 18:a="POI/fire_on.gif";break;case 19:a="POI/library_on.gif";break;case 20:a="POI/postoffice_on.gif";break;case 21:a="POI/cultural_on.gif";break;case 22:a="POI/multiple_on.gif";break;case 30:a="POI/listing_new.gif";break;case 31:a="POI/listing_pending.gif";break;case 32:a="POI/listing_sold.gif";break;case 33:a="POI/listing_openhouse.gif";break;case 34:a="POI/red-flag-only.png";break;case 35:a="POI/listing_expired.gif";break;case 41:a="POI/listing_active_selected.gif";break;case 42:a="POI/listing_other_selected.gif";break;case 43:a="POI/listing_pending_selected.gif";break;case 44:a="POI/listing_sold_selected.gif";break;case 45:a="POI/listing_expired_selected.gif";break;case 49:a="POI/listing_subjectproperty.gif";break;default:a="POI/"+b+".gif"}return a};pushpin.commitListingPinsFromChkbx=function(){if(this.listingShapes!=null&&listingShapes.length>0){try{GetLayer("LISTING").AddShape(listingShapes)}catch(a){Search.submit()}}else{Search.submit()}};pushpin.deleteListingPinsFromMap=function(){var a=GetLayer("LISTING");if(a){a.DeleteAllShapes();listingShapes=[];listingShapesHash=[];collisionPins=""}};message={};var _movingToolbar=false;var _advisoryPositionBottom=false;var msgError="An error has occurred retrieving your results";var msgTry="Please try again";var msgPF="Property Found";var msgPsF="Properties Found";var msgAdjust="To view properties please narrow your search criteria";var msgTM="Display limit is";var msgAdjust2="To view properties please change your search criteria";message.toggleListingMessage=function(a,d,c){var b="";if(a>0&&c>0&&c<=a){hideAdvisory()}else{if(isNaN(c)||c==-1){setAdvisoryText(msgError," "+msgTry)}else{if(c==1){setAdvisoryText('<div id="ab-count">1</div><div id="ab-pf">'+msgPF+"</div>")}else{if(c==0){setAdvisoryText('<div id="ab-count">0</div><div id="ab-pf0">'+msgPsF+"</div>",msgAdjust2)}else{if(c==-2){setAdvisoryText(msgError," "+msgTry)}else{setAdvisoryText('<div id="ab-count">'+Utils.Format.addCommas(c)+'</div><div id="ab-pf">'+msgPsF+" <br>"+msgTM+" "+a+"</div>",msgAdjust)}}}}}};function hideAdvisory(){if($.browser.msie&&parseInt($.browser.version.substring(0,1),10)<7){$("#mapsearch-advisory-box").hide()}else{$("#mapsearch-advisory-box").fadeTo("slow",0).hide()}}function setAdvisoryText(a,b){positionAdvisory();$("#advisory-count").html(a);$("#advisory-text").html(b);var c=$("#mapsearch-advisory-box");if($.browser.msie&&parseInt($.browser.version.substring(0,1),10)<7){$("#mapsearch-advisory-box").show()}else{$("#mapsearch-advisory-box").show().fadeTo("slow",0.9)}}function positionAdvisory(c){var g=$("#mapsearch-advisory-box");var f;if(activeView=="map"){f=$("#divMapControl").height()}else{f=$("#divMapControl").height();c=false}var b=(f-g.height())/2+50;var a=$("#mapsearch-toolbar").position().top-g.height()*2-9;var d=g.position().top;var e;if(activeView=="map"){e=a;$("#tdResults").height(0)}else{e=65;$("#tdResults").height(65)}g.css({top:e})}message.toggleMessage=function(a,c,d){var b=document.getElementById(a);if(d==0){c=""}if(b){document.getElementById(a).innerHTML=c}};message.closeTipBubble=function(a){hide(a);SetCookie("MapSearch_HelpTipAck",GetCookie("MapSearch_HelpTipAck")+"-"+a,50)};message.displayTipBubble=function(b){var a=GetCookie("MapSearch_HelpTipAck");if(a!=null&&a.indexOf("-"+b)>-1){hide(b)}else{display(b)}};message.displayLoading=function(d,a,c){var e=document.getElementById(d);if(e){var b='<img alt="" src="/Map/Images/MapControl/spinner.gif"';if(a!=null&&a>0){b+=" height="+a}b+=" />";if(c!=""&&c!=undefined){b+=" "+c}e.innerHTML=b}};message.hideLoading=function(a){var b=document.getElementById(a);if(b){b.innerHTML=""}};message.setInnerHTML=function(b,a){var c=document.getElementById(b);if(c){c.style.display="";c.innerHTML=a}};message.setTitle=function(b,a){var c=document.getElementById(b);if(c){c.style.display="";c.title=a}};ajax={};ajax.loadXMLDoc=function(url,callback){if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();eval("xmlhttp.onreadystatechange="+callback);xmlhttp.open("GET",url,true);xmlhttp.send(null)}else{if(window.ActiveXObject){xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");if(xmlhttp){eval("xmlhttp.onreadystatechange="+callback);xmlhttp.open("GET",url,true);xmlhttp.send()}}}};ajax.GetXmlHttpObject=function(){var a=null;if(window.XMLHttpRequest){a=new XMLHttpRequest()}else{if(window.ActiveXObject){a=new ActiveXObject("Microsoft.XMLHTTP")}}return a};browserDetect={};var agt=navigator.userAgent.toLowerCase();var is_major=parseInt(navigator.appVersion);var is_minor=parseFloat(navigator.appVersion);var is_nav=((agt.indexOf("mozilla")!=-1)&&(agt.indexOf("spoofer")==-1)&&(agt.indexOf("compatible")==-1)&&(agt.indexOf("opera")==-1)&&(agt.indexOf("webtv")==-1)&&(agt.indexOf("hotjava")==-1)&&(agt.indexOf("safari")==-1));var is_nav6up=(is_nav&&(is_major>=5));var is_ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1)&&(agt.indexOf("safari")==-1));var is_ie3=(is_ie&&(is_major<4));var is_ie4=(is_ie&&(is_major==4)&&(agt.indexOf("msie 4")!=-1));var is_ie5up=(is_ie&&!is_ie3&&!is_ie4);var is_aol=((agt.indexOf("aol")!=-1)&&(agt.indexOf("opera")==-1));var is_aol3=(is_aol&&is_ie3);var is_aol4=(is_aol&&is_ie4);var is_aol5=(agt.indexOf("aol 5")!=-1);var is_aol6=(agt.indexOf("aol 6")!=-1);var is_aol7=(agt.indexOf("aol 7")!=-1);var is_aol7up=(is_aol7||is_aol8||is_aol8up);var is_aol8=(agt.indexOf("aol 8")!=-1);var is_aol8up=(is_aol&&!is_aol3&&!is_aol4&&!is_aol5&&!is_aol6&&!is_aol7);browserDetect.firefox2Fix=function(){var c=0;var b="Firefox/";var a=navigator.userAgent.indexOf(b);if(a!=-1){c=parseFloat(navigator.userAgent.substring(a+b.length))}if(c>=1.5){Msn.Drawing.Graphic.CreateGraphic=function(e,d){return new Msn.Drawing.SVGGraphic(e,d)}}};browserDetect.isSupportedBrowser=function(){if(is_ie5up||is_nav6up||is_aol7up){return true}else{return false}};var DMP_AUTH_STATUS="VALID";var ReturnGeometryType={NONE:2,CENTRIOD:3,CENTROID:3,GEOMETRY:1,LATLON:4};function DMCException(b,a){this.msgCode=a;this.description=b;this.message=b;this.getMessage=c;this.toString=c;function c(){return b}}function DMCQueryControl(v,m){var b="http://parcelstream.com/Query.aspx";if(v!=null){b=v}var a="y_coord";var u="x_coord";var A=m;var t=null;var y=-1;var q=1;var k=0;var d="@@@@";var G=t;var C=200;var f=null;var p=null;var e=null;var o="json";var F=0;var r=false;var l=-1;var z=false;var h=20;var c=null;var j=null;var g=null;var s=null;var x=null;var B=0;var D=ReturnGeometryType.GEOMETRY;var w=null;var n=null;this.setKeyField=function(H){n=H};this.getKeyField=function(){return n};this.setLatitudeField=function(H){a=H};this.setLongitudeField=function(H){u=H};this.getSelectAttributeName=function(){return"attr"};this.getAttributeCondName=function(){return"attrConds"};this.setSelectAttributes=function(H){G=H};this.getSelectAttributes=function(){return G};this.setMaxOutputRecords=function(H){C=H};this.setOrderByAttribute=function(H){f=H};this.setWhereClause=function(I,H){p=I;e=H};this.setAPNFilter=function(I,H){j=I;g=H};this.setID=function(H){c=H};this.setGeometryFilter=function(H){s=H};this.setSpatialReference=function(H){x=H};this.setGeometryBufferDistance=function(H){B=H};this.setReturnGeometryType=function(H){D=H};this.setOutputType=function(H){o=H};this.setMinRecords=function(H){F=H};this.setNoSchema=function(H){r=H};this.setNoRecordsIfOverN=function(H){l=H};this.setIsTileOutSearch=function(H){z=H};this.setMaxRadius=function(H){h=H};this.getQueryServiceUrl=function(){return b};this.getResourceName=function(){return A};this.getDataSource=function(){return A};this.setDataSource=function(H){A=H};this.getQuery=function(){var I=b+"?";if(p!=null&&p.length>0){I+="attrConds=";if(typeof(p)=="string"){I+=this.encodeParameter(p)}else{for(var J=0;J<p.length;J++){var K=p[J];if(K==null||K==""){continue}I+=this.encodeParameter(K);if(J!=p.length-1){I+=d}}}}if(e!=null){I+="&andCond="+this.encodeParameter(e)}var H=G;if(D!=null&&D>=0){if(D==ReturnGeometryType.LATLON){H=H.toUpperCase();H=ReplaceString(H,"GEOMETRY",a+" AS _LATFIELD,"+u+" AS _LONFIELD")}else{I+="&returnGeoType="+D}}if(H!=null){I+="&attr="+this.encodeParameter(H)}if(C!=null){I+="&maxRecords="+C}if(A!=null&&A.length>0){I+="&DataSource="+this.encodeParameter(A)}if(f!=null){I+="&orderBy="+this.encodeParameter(f)}if(x!=null&&x.length>0){I+="&srs="+this.encodeParameter(x)}if(B!=null&&B>0){I+="&geoBufferDist="+B}if(s!=null){I+="&geoFilter="+this.encodeParameter(s)}if(c){I+="&ID="+this.encodeParameter(c)}else{if(j&&g){I+="&APN="+this.encodeParameter(j);I+="&FIPS="+this.encodeParameter(g)}}if(o!=null&&o.toLowerCase()!="json"){I+="&output="+this.encodeParameter(o)}if(F!=null&&F>0){I+="&minRecords="+this.encodeParameter(F)}if(r!=null&&r==true){I+="&noSchema=true"}if(l!=null&&l>1){I+="&noRecordsIfOverN="+this.encodeParameter(l)}if(z!=null&&z==true&&s!=null){I+="&isTileOutSearch=true";if(h!=null&&h>1){I+="&maxRadius="+this.encodeParameter(h)}if(a!=null){I+="&latField="+this.encodeParameter(a)}if(u!=null){I+="&lonField="+this.encodeParameter(u)}}return I};this.geocode=function(P,J,K,I,O,N,L,M,Q,H){if(w==null){w=new DMPGeocoder()}w.geocodeByAddress(P,J,K,O,N,L,M,Q,H)};var E=0;this.execute=function(I,H,M,K){var J=this.getQuery();try{var N=new _DMCQueryControlObserver(I,H,M,this.getResourceName(),n);if(K==null||typeof(K)=="undefined"){K="query"+K++}gLoadJSON(J,N,"onSuccess","onError",K)}catch(L){alert("Error DMCQueryCOntrol:"+L.description)}};this.encodeParameter=function(H){if(H!=null){return encodeURIComponent(H)}return""}}function _DMCQueryControlObserver(c,a,f,e,b){if(c==null){throw new DMCException("DMCQueryControlObserver: observer is undefined")}if(c[a]==null){throw new DMCException("DMCQueryControlObserver: observer must have a success method '"+a+"()' ")}if(c[f]==null){throw new DMCException("DMCQueryControlObserver: observer must have an error method '"+f+"()' ")}var d=this;this._observer=c;this._onSuccessMethod=a;this._onErrorMethod=f;this._dataSourceName=e;this.onSuccess=function(g,h,k){if(b==null&&typeof(c.getKeyField)!="undefined"){b=c.getKeyField()}var l=d._dataSourceName;if(c.getLayerName){l=c.getLayerName()}var j=JSON2RecordSet(g,b,l);c[a](j,e)};this.onError=function(h,j,g){c[f](h,j,g)};this.tryParse=function(h,g){if(h==null||g==null){return g}if(h=="int"){return parseInt(g)}else{if(h=="double"||h=="float"){return parseFloat(g)}else{if(h=="bool"){if(g=="1"||g=="true"){return true}else{return false}}else{return g}}}}}function DMPGeocoder(c){var d=1;var e="http://parcelstream.com/Geocode.aspx";if(c!=null){e=c}var a=["ID","DATASOURCE","ADDRESS","ZIP"];this.geocodeByAddress=function(p,g,h,o,m,j,k,q,f){if(f!=null&&f==true){f="true"}else{f=""}var r=e+"?";r+=b("address",o);r+=b("city",m);r+=b("state",j);r+=b("zip",k);r+=b("includeGeo",f);r+=b("minScore",q);try{var l=new _DMCQueryControlObserver(p,g,h,"",a);d=d++;gLoadJSON(r,l,"onSuccess","onError",d)}catch(n){alert("Error DMPGeocoder:"+n.description)}};function b(f,g){if(typeof(g)!="undefined"&&typeof(f)!="undefined"&&f!=null&&f!=""&&g!=""&&g!=null){return"&"+f+"="+encodeURIComponent(g)}return""}}function CPriority(){this.LOW=1000;this.MEDIUM=20;this.HIGH=2;this.HIGHEST=1}var Priority=new CPriority();if(typeof(Dmp)=="undefined"){Dmp=new Object()}Dmp.Event=function(b,a,c){this.eventType=b;this.consumed=false;this.source=a;this.data=(c?c:a);this.cancel=false;this.getSource=function(){return this.source};this.getStatus=function(){return this.eventType};this.getEventType=function(){return this.eventType};this.getData=function(){return this.data}};Dmp.EventManager=function(){this._event2PriorityArray=new Array();this._eventPassed=new Array();this.notify=function(d){if(d==null){throw new DMCException("Event object is NULL")}if(d.eventType==null){throw new DMCException("evtObj.eventType is NULL")}if(d.deadEvent){this.setDispatchedEvent(d.eventType,d)}var e=this._event2PriorityArray[d.eventType];if(e==null){return null}for(var f=0;f<e.length;f++){var b=e[f];var c=b.observer;var g=b.funcName;c[g](d);if(d.cancel==true){return}}};this.setDispatchedEvent=function(c,b){this._eventPassed[c]=b};this.addObserver=function(j,e,d,k,f){if(j==null||d==null){return}if(e==null){e="handleEvent"}if(k==null){k=20}if(j[e]==null){throw new DMCException("An observer must support "+e+" method.")}var h=this._eventPassed[d];if(h!=null&&typeof(f)!=undefined&&f!=true){j[e](h)}var b=this._event2PriorityArray[d];if(b==null){b=new Array();this._event2PriorityArray[d]=b}var g=this.indexOf(b,j);if(g<0){g=b.length;var c=new Object();c.observer=j;c.funcName=e;c.eventType=d;c.priority=k;b[g]=c}b.sort(a)};function a(c,d){if(c.priority==null){c.priority=20}if(d.priority==null){d.priority=20}if(c.priority<d.priority){return -1}else{if(c.priority>d.priority){return 1}else{return 0}}}this.indexOf=function(c,b){if(c==null||b==null){return -1}for(var d=0;d<c.length;d++){if(c[d].observer==b){return d}}return -1};this.remove=function(b,c){return this.removeObserver(b,c)};this.removeObserver=function(b,c){if(c==null){return}if(b==null){return removeAll(c)}var d=this._event2PriorityArray[c];if(d==null){return}var f=[];for(var e=0;e<d.length;e++){if(d[e].observer==b){continue}f.push(d[e])}this._event2PriorityArray[c]=f};this.removeAll=function(b){if(b==null){return}var c=this._event2PriorityArray[b];if(c==null){return}this._event2PriorityArray[b]=null}};function _gNotifyAsyncObs(_gid){try{var po=null;var eo=null;var str="po = window.PO"+_gid+"; window.PO"+_gid+" = null;";eval(str);eval("eo = window.EO"+_gid+"; window.PO"+_gid+" = null;");if(po==null){return}po._dmc_notifyEvent(eo.eventType,eo)}catch(ex){alert("_gNotifyAsyncObs: "+ex.description)}}function _dmc_notifyEvent(eventType,evtObj){if(eventType==null){eventType=evtObj.eventType}var funcName=this._dmcEventMethodNames[eventType];eval("this."+funcName+"(evtObj);")}if(typeof(Event)=="undefined"){Event=Dmp.Event}if(typeof(EventManager)=="undefined"){EventManager=Dmp.EventManager}function JSON2RecordSet(c,v,a){var w=false;if(v==null||v.length==0||(v.length==1&&v[0]=="")){v="_ridx";w=true}if(typeof(v)=="string"){v=[v]}var f=new Array();var m=[];if(c!=null){var g=null;try{g=c.Xml.Data.Row}catch(d){}if(g==null){g=new Array()}var r=null;if(c.Xml.Schema){r=c.Xml.Schema.ElementType.AttributeType}if(g&&g.length==null){g=[g]}if(r&&r.length==null){r=[r]}var n=[];if(r){for(var j=0;j<r.length;j++){var t=r[j].Datatype.type;m[r[j].name]=t;n[r[j].name]=r[j].basecolumn}}for(var j=0;j<g.length;j++){var e=g[j];var h=new Dmp.Record(v,a);if(w){h.setByName(v[0],(j+1)+"","string")}if(e._LATFIELD&&e._LONFIELD&&e.GEOMETRY==null){var l=tryParse("double",e._LATFIELD);var u=tryParse("double",e._LONFIELD);h.setByName("GEOMETRY",new DMCPoint(u,l),"geometry")}var p=0;for(property in e){if(property=="_LATFIELD"||property=="_LONFIELD"){continue}var o=n[property];if(o==null){o=property}var x=m[property];if(x==null){x="string"}var t=x=="wkt"?"geometry":x;h.setByName(o,tryParse(x,e[property]),t)}f.push(h)}}var s="QueryRecordset";if(a!=null&&a.length>0){s=a}var k=[];if(w){k.push(v[0])}for(var b in m){k.push(b)}var q=new Dmp.RecordSet(v,k);q.addRecordCollection(f);return(q)}function tryParse(b,a){if(b==null||a==null){return a}if(b=="int"){return parseInt(a)}else{if(b=="double"||b=="float"){return parseFloat(a)}else{if(b=="bool"){return(a=="1"||a=="true")}else{if(b=="wkt"){return WKT(a)}else{if(b=="date"){if(a==""){return null}a=a.replace(/00:00:00.0/,"");a=a.replace(/-/g,"/");a=new Date(a);if((a+"")=="NaN"){return null}return a}else{if(b=="string"){return a}else{return a}}}}}}}function deepCloneJSON(e){if(e==null){return e}var b=null;var c=getDataType(e);if(c=="associative array"){b=[];for(var d in e){b[d]=deepCloneJSON(e[d])}return b}else{if(c=="array"){b=[];for(var a=0;a<e.length;a++){b.push(deepCloneJSON(e[a]))}return b}else{return e}}}function getDataType(d){if(d==null){return null}var a=typeof(d);if(a.indexOf("object")<0){return a}try{for(var c in d){if(c!=null&&d[c]!=null){return"associative array"}break}}catch(b){}if(d.length>0){if(d[0]!=null){return"array"}}return a}function OrderedHashtable(){this._columnNames=[];this._columnNameIndices=[];this._fieldArray=[];this._dataTypes=[];this.setByName=function(a,c,b){if(a!=null){a=(""+a).toUpperCase()}this._fieldArray[a]=c;if(b&&this._dataTypes[a]==null){if(b=="wkt"){this._dataTypes[a]="geometry"}else{this._dataTypes[a]=b}}if(this._columnNameIndices[a]==null){this._columnNameIndices[a]=this._columnNames.length;this._columnNames.push(a)}};this.getByName=function(a){if(a!=null){a=(""+a).toUpperCase()}return this._fieldArray[a]};this.getDataTypeByName=function(a){return this._dataTypes[a]};this.clear=function(){this._fieldArray=[];this._columnNameIndices=[];this._columnNames=[]};this.getCount=function(){return this._columnNames.length};this.contains=function(a){if(a!=null){a=a.toUpperCase()}return this._columnNameIndices[a]!=null};this.remove=function(b){if(b!=null){b=(""+b).toUpperCase()}var a;if((a=this._columnNameIndices[b])==null){throw new DMCException("GridControl.remove: trying to remove an inexisting field : "+b)}delete this._fieldArray[b];delete this._columnNameIndices[b];this._columnNames.splice(a,1);for(var d=a;d<this._columnNames.length;d++){var c=this._columnNames[d];this._columnNameIndices[c]=d}};this.removeAll=function(c){var d=[];for(var b=0;b<c.length;b++){var f=c[b];if(f!=null){f=(""+f).toUpperCase()}var g;if((g=this._columnNameIndices[f])==null){d.push(f);continue}this._fieldArray[f]=null;this._columnNameIndices[f]=null;this._columnNames.splice(g,1)}for(var a=0;a<this._columnNames.length;a++){var h=this._columnNames[a];this._columnNameIndices[h]=a}if(d.length>0){var e="GridControl.removeAll: failed to remove "+d.join()+"\n\twhen removing: "+c.join();throw new DMCException(e)}};this.getByIndex=function(a){return this._fieldArray[this._columnNames[a]]};this.getNameByIndex=function(a){return this._columnNames[a]};this.getNames=function(){var a=[];var b;for(b in this._fieldArray){a.push(b)}return a}}Dmp.Record=function(a,b){this.base=OrderedHashtable;this.base();this.FIELD_DELIMITER="+*+";this._resourceName=b;this._keyArray=a;this._properties=[];this.setResourceName=function(c){this._resourceName=c};this.getKeyField=function(){return this._keyArray[0]};this.getResourceName=function(){return this._resourceName};this.getRowNumber=function(){return this.getProperty("RowNumber")};this.setKeyField=function(c){this._keyArray=[c]};this.setCompositeKeyField=function(c){this._keyArray=c};this.getCompositeKeyField=function(){return this._keyArray};this.getKey=function(){var c=this.getByName(this._keyArray[0]);for(var d=1;d<this._keyArray.length;d++){c+=this.FIELD_DELIMITER+this.getByName(this._keyArray[d])}return c};this.getCompositeKey=function(){var d=[];for(var e=0;e<this._keyArray.length;e++){var f=this._keyArray[e];var c=this.getByName(f);d[f]=c}return d};this.clone=function(){var c=new Dmp.Record(this._keyArray,this._resourceName);for(var f in this._columnNames){c._columnNames[f]=this._columnNames[f]}for(var e in this._columnNameIndices){c._columnNameIndices[e]=this._columnNameIndices[e]}for(var d in this._fieldArray){c._fieldArray[d]=this._fieldArray[d]}c._keyArray=this._keyArray;return c};this.isSameRecord=function(c){for(var f in this._columnNames){if(c._columnNames[f]!=this._columnNames[f]){return false}}for(var e in this._columnNameIndices){if(c._columnNameIndices[e]!=this._columnNameIndices[e]){return false}}for(var d in this._fieldArray){if(c._fieldArray[d]!=this._fieldArray[d]){return false}}if(c._keyArray!=this._keyArray){return false}return true};this.getProperty=function(c){return this._properties[c]};this.removeProperty=function(c){delete this._properties[c]};this.hasProperty=function(c){return this._properties[c]!=null};this.setProperty=function(d,c){this._properties[d]=c};this.getProperties=function(){return this._properties}};if(typeof(Record)=="undefined"){Record=Dmp.Record}Dmp.RecordSet=function(c,g,e){var h=this;this.className="RecordSet";this._records=new OrderedHashtable();this._keyArray=c;this.base=Dmp.EventManager;this.base();var a="Cannot add additional records to collection";var b=2000;if(typeof(e)!=undefined&&e!=null){b=e}this.setExceedMaxRecordsMessage=function(j){a=j+" Exceeded maximum allowable records: "+b};this._listOfColumnNames=g;this.getKeyFields=function(){return this._keyArray};this.clear=function(){this._records=new OrderedHashtable()};this.setCompositeKeyField=function(j){this._keyArray=j};this.getColumnNames=function(){return this._listOfColumnNames};this.newRecord=function(j){return new Dmp.Record(this._keyArray,j)};this.setRecord=function(j,o){if(h.getCount()>b){alert(a);return}var k=j.getKey();var m=this._records.contains(k);var n=null;if(m&&!o){n=this._records.getByName(k).clone()}this._records.setByName(k,j);if(!o){if(m){var l=new Dmp.Event("recordUpdated",this,j);l.oldRecord=n;l.newRecord=j;this.notify(l)}else{this.notify(new Dmp.Event("recordAdded",this,j))}}return j};this.getRecord=function(j){var k=this._records.getByName(j);if(!k){return null}else{return k}};this.removeRecord=function(k,l){var j=this._records.getByName(k);if(!j){return}this._records.remove(k);if(!l){this.notify(new Dmp.Event("recordRemoved",this,j))}return j};this.clone=function(){var j=new Dmp.RecordSet(this._keyArray,this.getColumnNames());for(var k=0;k<this._records.getCount();k++){j.setRecord(this._records.getByIndex(k).clone())}return j};this.addRecordCollection=function(l){var k=new Array();var n=new Array();var o=true;for(var p=0;p<l.length;p++){var m=this._records.contains(l[p].getKey());var j=this.setRecord(l[p],o);if(m){n.push(j)}else{if(h.getCount()>b){alert(a);break}k.push(j)}}if(k.length>0){this.notify(new Dmp.Event("recordCollectionAdded",this,k))}return n};this.toArray=function(){var j=[];for(var k=0;k<this._records.getCount();k++){j.push(this._records.getByIndex(k))}return j};this.removeRecordCollection=function(k){var l=true;var m=[];for(var n=0;n<k.length;n++){if(this.getRecord(k[n])){var j=this.removeRecord(k[n],l);m.push(j)}}this.notify(new Dmp.Event("recordCollectionRemoved",this,m));return m};this.clearRecords=function(l){var j=this.toArray();if(!l){var k=null;k=new Dmp.Event("beforeRecordsCleared",this,j);this.notify(k);if(k.cancel==true){return false}}this._records.clear();if(!l){this.notify(new Dmp.Event("recordsCleared",this,j))}return true};this.getKeys=function(){var j=[];var l;for(l in this._records._fieldArray){j.push(l)}return j};this.toRecordArray=function(){var l=[];var j=this.getByCount();for(var k=0;k<j;k++){l.push(this.getByIndex(k))}return l};this.importData=function(D,G){this.clearRecords();if(!D){return}var o=[];var n=true;try{var r=[];this._keyArray=[];var w=D.selectSingleNode("Xml/Schema");var s=w.getAttribute("keys");if(s){this._keyArray=s.split(",")}var L=D.selectNodes("Xml/Schema/ElementType/AttributeType");for(var y=0;y<L.length;y++){var K=L[y];var p=K.getAttribute("basecolumn");r[p]=K.selectSingleNode("Datatype").getAttribute("type");if(s==null&&K.getAttribute("keycolumn")=="true"){this._keyArray.push(p)}}var z=D.selectNodes("Xml/Data/Row");for(var C=0;C<z.length;C++){var x=z[C];var v=null;var m=G;if(!m){var m=x.getAttribute("__resName");if(m==null){m="_importedFromFile"}}v=new Dmp.Record(this._keyArray,m);if(this._keyArray.length>1){v.setCompositeKeyField(this._keyArray)}for(var E in r){var l=x.getAttribute(E);if(l!=null){var J=r[E];l=tryParse(J,l)}v.setByName(E,XMLAbstraction.decode(l),J)}o.push(v);this.setRecord(v,n)}var u=D.selectNodes("Xml/Properties/Properties");for(var C=0;C<u.length;C++){var H=u[C];var v=null;var B=H.getAttribute("__key");if(B==null){continue}var F=this.getRecord(B);if(F==null){continue}var q=H.attributes;for(var A=0;A<q.length;A++){var t=q[A].nodeName;if(t=="RowNumber"||t=="__key"){continue}F.setProperty(t,XMLAbstraction.decode(H.getAttribute(t)))}}}catch(I){throw new Exception("RecordSet.importData(): malformatted xmlDOM: "+D==null?null:D.xml)}this.notify(new Dmp.Event("recordCollectionAdded",this,o))};this.exportData=function(){if(this.getCount()<=0){return null}var w=gGetDomFromString("");var E=w.createElement("Xml");var s=w.createElement("Schema");var n=w.createElement("Data");var D=w.createElement("Properties");E.appendChild(s);E.appendChild(n);E.appendChild(D);var B=[];for(var t=0;t<this._keyArray.length;t++){B[this._keyArray[t]]=true}s.setAttribute("keys",this._keyArray.join(","));var p=this.getByIndex(0);var A=[];for(var u=0;u<this.getCount();u++){var p=this.getByIndex(u);for(var t=0;t<p.getCount();t++){var m=p.getNameByIndex(t);var q=p.getByIndex(t);if(A[m]){continue}else{A[m]=true}var x=w.createElement("ElementType");x.setAttribute("name","row");var F=w.createElement("AttributeType");x.appendChild(F);F.setAttribute("name",m);F.setAttribute("number",t+1);F.setAttribute("basecolumn",m);if(B[m]){F.setAttribute("keycolumn","true")}var l;if(typeof q=="number"){l="float"}else{if(q==null||typeof q=="string"){l="string"}else{if(typeof q=="boolean"){l="bool"}else{if(d(q)){l="date"}else{if(q.TYPE=="POLYGON"||q.TYPE.indexOf("LINE")>=0||q.TYPE=="POINT"){l="wkt"}else{throw new DMCException("RecordSet.exportData(): not supported value type : "+q)}}}}}var C=w.createElement("Datatype");C.setAttribute("type",l);F.appendChild(C);s.appendChild(x)}}for(var t=0;t<this.getCount();t++){var p=this.getByIndex(t);var o=w.createElement("Row");for(var u=0;u<p.getCount();u++){o.setAttribute(p.getNameByIndex(u),XMLAbstraction.encode(""+p.getByIndex(u)))}o.setAttribute("__resName",p.getResourceName());n.appendChild(o)}for(var t=0;t<this.getCount();t++){var p=this.getByIndex(t);var k=p.getProperties();var z=null;for(var y in k){if(y=="RowNumber"){continue}if(z==null){z=w.createElement("Properties")}z.setAttribute(y,XMLAbstraction.encode(k[y]))}if(z==null){continue}z.setAttribute("__key",p.getKey());D.appendChild(z)}return E};function f(k){var j=/^\s+$/;return((k==null)||(k.length==0)||j.test(k))}function d(j){var k=new Date(j);return !f(j)&&!isNaN(k)}this.getCount=function(){return this._records.getCount()};this.getByIndex=function(j){return this._records.getByIndex(j)};this.getEmptyRecordSet=function(){return new Dmp.RecordSet(this._keyArray,this._listOfColumnNames)}};if(typeof(RecordSet)=="undefined"){RecordSet=Dmp.RecordSet}if(typeof(Dmp.Utils)=="undefined"){Dmp.Utils=new Object()}Dmp.Utils.pause=function(a){var b=window.showModalDialog("../AJAX-Spring/Util/_dmcsleepWindow.html",a,"dialogLeft:2000px;dialogTop:2000px;dialogHeight:1px;dialogWidth:1px;")};if(typeof(pause)=="undefined"){pause=Dmp.Utils.pause}function gSleep(a){try{var b=new XMLHttpRequest();b.open("GET","someFakeDocument.xml",false);b.send("")}catch(c){}}function gLoadJSON(g,h,d,e,f){function c(){}var a=null;if(f){a=f}else{a=getGUID()}_gDMCObserverLounge[a]=h;var b=g;if(g.indexOf("?")>0){b+="&"}else{b+="?"}b+='obsId=_gDMCObserverLounge["'+a+'"]';b+="&obsSuccessMethod="+d;b+="&obsErrorMethod="+e;b+="&output=JSON";_gDmcLoadScript(b,c,f)}var _gDMCLOGIN_URL="http://maps.digitalmapcentral.com/production/init";function ProcessError(a){if(a.indexOf("User not found")>=0){document.location.href=_gDMCLOGIN_URL;return}alert(a)}var _gDMCObserverLounge=new Array();function _gDMCNotifyJSON(obsID){var observer=_gDMCObserverLounge[obsID];if(observer==null){observer=eval(obsID)}return observer}function _gDmcLoadScript(a,c,b){if(document.all){_gDmcLoadScriptIE(a,c,b)}else{_gDmcLoadScriptMOZILLA(a,c,b)}}function _gDmcLoadScriptMOZILLA(e,h,c){var a=document.getElementsByTagName("head").item(0);var g=document.createElement("script");g.setAttribute("language","JavaScript1.2");g.setAttribute("src",e);if(c){g.setAttribute("id",c)}var d=0;if(h){g.addEventListener("load",h,false)}else{function b(){d=100}g.addEventListener("load",b,false)}a.appendChild(g);if(!h){try{while(d<50){gSleep(200);d++}}catch(f){}}}function _gDmcLoadScriptIE(c,f,e){var a=document.getElementsByTagName("head").item(0);var d=document.createElement("script");d.setAttribute("src",c);if(e){d.setAttribute("id",e)}if(f==null){if(d.readyState!="loaded"){var b=0;d.onreadystatechange=function(){if(this.readyState=="loaded"){d.onreadystatechange=null;b=100}};while(b<50&&d.readyState!="loaded"&&d.readyState!="complete"){Dmp.Utils.pause(100);b++}}}else{if(d.readyState=="loaded"||d.readyState=="complete"){f()}else{if(d.readyState!="loaded"){d.onreadystatechange=function(){if(this.readyState=="loaded"){f();d.onreadystatechange=null}}}else{alert("Cannot load data url:"+c)}}}a.appendChild(d)}function _gDmcRemoveScriptTagById(c){var a=document.getElementsByTagName("head").item(0);var b=document.getElementById(c);if(b){a.removeChild(b);return}else{}return false}if(typeof(Dmp.Geometry)=="undefined"){Dmp.Geometry=new Object()}function DMCtoVEGeometry(g,f){if(!f){f=g}if(!f.TYPE){throw new DMCException("DMCtoVEGeometry: input is not a DMC javascript geometry")}try{var h=f.getPoints();var d=[];for(var c=0;c<h.length;c++){d.push(new VELatLong(h[c].getY(),h[c].getX()))}if(f.TYPE=="POLYGON"||f.TYPE=="BOUNDS"){return new VEShape(VEShapeType.Polygon,d)}else{if(f.TYPE=="CIRCLE"){var a=new VEShape(VEShapeType.Pushpin,d[0]);return a}else{if(f.TYPE=="LINESTRING"){return new VEShape(VEShapeType.Polyline,d)}else{if(f.TYPE=="POINT"){return new VEShape(VEShapeType.Pushpin,d)}}}}}catch(b){}throw new DMCException("DMCtoVEGeometry: input is an not a DMC javascript geometry")}function DMCPoint3D(a,b,c){this.x=a;this.y=b;this.z=c;this.dot=function(d){return this.x*d.x+this.y*d.y+this.z*d.z}}function DMCBounds(b){this.TYPE="BOUNDS";this.xMin;this.yMin;this.xMax;this.yMax;if(b&&b.length>0){this.xMin=this.xMax=b[0].x;this.yMin=this.yMax=b[0].y;for(var a=1;a<b.length;a++){if(b[a].x<this.xMin){this.xMin=b[a].x}else{if(b[a].x>this.xMax){this.xMax=b[a].x}}if(b[a].y<this.yMin){this.yMin=b[a].y}else{if(b[a].y>this.yMax){this.yMax=b[a].y}}}}this.setBounds=function(c,d,e,f){this.xMin=c;this.yMin=d;this.xMax=e;this.yMax=f};this.min=function(){return new DMCPoint(this.xMin,this.yMin)};this.getMin=this.min;this.max=function(){return new DMCPoint(this.xMax,this.yMax)};this.getMax=this.max;this.equals=function(c){return c.xMin==this.xMin&&c.xMax==this.xMax&&c.yMin==this.yMin&&c.yMax==this.yMax};this.contains=function(c){return c.x>=this.xMin&&c.x<=this.xMax&&c.y>=this.yMin&&c.y<=this.yMax};this.containsBounds=function(c){return c.xMin>=this.xMin&&c.xMax<=this.xMax&&c.yMin>=this.yMin&&c.yMax<=this.yMax};this.intersects=function(c){if((!((this.xMax<c.xMin)||(this.xMin>c.xMax)))&&(!((this.yMax<c.yMin)||(this.yMin>c.yMax)))){return true}return false};this.extend=function(c){if(c.x>this.xMax){this.xMax=c.x}else{if(c.x<this.xMin){this.xMin=c.x}}if(c.y>this.yMax){this.yMax=c.y}else{if(c.y<this.yMin){this.yMin=c.y}}};this.intersection=function(c){var d,e,f,g;var h=0;if(c.xMin>=this.xMin&&c.xMin<=this.xMax){d=c.xMin;++h}if(c.xMax>=this.xMin&&c.xMax<=this.xMax){f=c.xMax;++h}if(h<2){if(this.xMin>=c.xMin&&this.xMin<=c.xMax){d=this.xMin;++h}if(this.xMax>=c.xMin&&this.xMax<=c.xMax){f=this.xMax;++h}}if(h<2){return new DMCBounds([new DMCPoint(0,0),new DMCPoint(0,0)])}h=0;if(c.yMin>=this.yMin&&c.yMin<=this.yMax){e=c.yMin;++h}if(c.yMax>=this.yMin&&c.yMax<=this.yMax){g=c.yMax;++h}if(h<2){if(this.yMin>=c.yMin&&this.yMin<=c.yMax){e=this.yMin;++h}if(this.yMax>=c.yMin&&this.yMax<=c.yMax){g=this.yMax;++h}}if(h<2){return new DMCBounds([new DMCPoint(0,0),new DMCPoint(0,0)])}return new DMCBounds([new DMCPoint(d,e),new DMCPoint(f,g)])};this.getSouthEast=function(){return new DMCPoint(this.xMax,this.yMin)};this.getSouthWest=function(){return new DMCPoint(this.xMin,this.yMin)};this.getNorthEast=function(){return new DMCPoint(this.xMax,this.yMax)};this.getNorthWest=function(){return new DMCPoint(this.xMin,this.yMax)};this.toSpan=function(){return new DMCPoint(this.xMax-this.xMin,this.yMax-this.yMin)};this.isValidLat=function(){return this.yMin<=-90&&this.yMax>=90};this.isValidLng=function(){return this.max<=-180&&this.yMax>=180};this.isEmpty=function(){return this.xMin>=this.xMax||this.yMin>=this.yMax};this.getCenter=function(){return new DMCPoint((this.xMax+this.xMin)/2,(this.yMax+this.yMin)/2,true)};this.getPoints=function(){return[new DMCPoint(this.xMin,this.yMin),new DMCPoint(this.xMin,this.yMax),new DMCPoint(this.xMax,this.yMax),new DMCPoint(this.xMax,this.yMin),new DMCPoint(this.xMin,this.yMin)]};this.toString=function(){var c=new DMCPolygon(this.getPoints());return c.toString()}}function DMCPoint(a,b,c){this.TYPE="POINT";this.x=a;this.y=b;if(!c){this.y=Math.max(-90,this.y);this.y=Math.min(90,this.y);this.x=Math.max(-180,this.x);this.x=Math.min(180,this.x)}this.toString=function(){return"POINT("+this.x+" "+this.y+")"};this.getX=function(){return this.x};this.getY=function(){return this.y};this.setX=function(d){this.x=d};this.setY=function(d){this.y=d};this.getLat=function(){return this.y};this.getLng=function(){return this.x};this.getPoints=function(){return[this]};this.setPoints=function(d){var e=null;if(typeof(d.length)!="undefined"&&d.length>0){e=d[0]}else{e=d}if(e!=null){this.x=e.x;this.y=e.y}};this.getLatRadians=function(){return this.y*Math.PI/180};this.getLngRadians=function(){return this.x*Math.PI/180};this.equals=function(d){return this.y==d.y&&this.x==d.x};this.intersects=function(e){if(e==null){throw new DMCException("DMCPoint.intersects can not take a null parameter")}if(e.TYPE=="POINT"){return this.equals(e)}if(e.TYPE=="POLYGON"||e.TYPE=="CIRCLE"){var f=e.contains(this);return f}if(e.TYPE=="BOUNDS"){var f=e.contains(this);return f}if(e.TYPE=="LINESTRING"){var h=false;var d=Math.EPSILON;for(var g=0;g<e.getVertexCount()-1;g++){var h=pointCloseToSegment(e.getVertex(g),e.getVertex(g+1),this,d);if(h){break}}return h}throw new DMCException("Other geometry types no supported.")};this.getCentroid=function(){return new DMCPoint(this.x,this.y,c)};this.getCenter=function(){return new DMCPoint(this.x,this.y,c)};this.getHandles=function(){var d=[];var e={TYPE:"WHOLE",INDEX:0,GEOMETRY:this};d.push(e);return d};this.modifyByHandle=function(e,d){this.x=d.x;this.y=d.y};this.projectToPixels=function(d){return d.latLngToPixel(this)}}function _pointArray1DtoPointArray(a){var c=[];for(var b=0;b<a.length;b+=2){c.push(new DMCPoint(a[b],a[b+1]))}return c}function DMCPoly(a,b){this.points=a;if(!this.points){this.points=[]}this.TYPE=b;var c=this;this.getVertexCount=function(){return this.points.length};this.getVertex=function(d){return this.points[d]};this.getPoints=function(){return this.points};this.setPoints=function(d){this.points=d};this.getBounds=function(){return new DMCBounds(this.points)};this.getArea=function(){return 0};this.getLength=function(){return _getLength(this.points)};this.intersects=function(d){throw new DMCException("Intersects implemenation is not supported to DMCLineString")};this.getHandles=function(){var f=[];var d=this.points.length;for(var h=0;h<(d-1);h++){var j=this.points[h];var g=this.points[h+1];var e=new DMCPoint((j.x+g.x)/2,(j.y+g.y)/2,true);f.push({TYPE:"INSERT_VERTEX",PT_INDEX:h,INDEX:f.length-1,GEOMETRY:e})}for(var h=0;h<d;h++){var k=new DMCPoint(this.points[h].x,this.points[h].y);f.push({TYPE:"VERTEX",PT_INDEX:h,INDEX:f.length-1,GEOMETRY:k})}f.push({TYPE:"WHOLE",INDEX:f.length-1,GEOMETRY:this.getClone()});return f};this.modifyByHandle=function(h,l,f){var j=h.PT_INDEX;if(h.TYPE=="VERTEX"){var g=this.points[j];g.x=l.x;g.y=l.y;if(this.TYPE=="POLYGON"){if(j==0){var g=this.points[this.points.length-1];g.x=l.x;g.y=l.y}else{if(j==this.points.length-1){var g=this.points[0];g.x=l.x;g.y=l.y}}}}else{if(h.TYPE=="WHOLE"){var e=l.x-f.x;var k=l.y-f.y;for(var d=0;d<this.points.length;d++){this.points[d].x+=e;this.points[d].y+=k}}else{if(h.TYPE=="INSERT_VERTEX"){return c.insertVertex(h.GEOMETRY,j+1)}}}};this.insertVertex=function(f,h){var d=this.points.length;if(h<0||h>d){return false}var e=[];for(var g=0;g<d;g++){if(g==h){e.push(f)}e.push(this.points[g])}this.points=e;return true};this.projectToPixels=function(f){var d=[];for(var e=0;e<this.points.length;e++){d.push(f.latLngToPixel(this.points[e]))}return new DMCLineString(d)}}function DMCLineString(a){this.base=DMCPoly;this.base(a,"LINESTRING");this.toString=function(){var b=this.TYPE+"(";for(var c=0;c<this.points.length;c++){if(c!=0){b+=","}b+=this.points[c].x+" "+this.points[c].y}b+=")";return b};this.getCenter=function(){var b=a.length;var d;var c=0;var e=0;for(d in a){c+=a[d].getX();e+=a[d].getY()}if((a[0].getX()==a[b-1].getX())&&(a[0].getY()==a[b-1].getY())){b=b-1;c-=a[0].getX();e-=a[0].getY()}return new DMCPoint(c/b,e/b)};this.getClone=function(){var b=[];for(var c=0;c<this.points.length;c++){b.push(new DMCPoint(this.points[c].x,this.points[c].y))}return new DMCLineString(b)}}DMCLineString.prototype=new DMCPoly();function DMCPolygon(a){this.base=DMCPoly;this.base(a,"POLYGON");this.getClone=function(){var b=[];for(var c=0;c<this.points.length;c++){b.push(new DMCPoint(this.points[c].x,this.points[c].y))}return new DMCPolygon(b)};this.toString=function(){var b="POLYGON((";for(var c=0;c<this.points.length;c++){if(c!=0){b+=","}b+=this.points[c].x+" "+this.points[c].y}b+="))";return b};this.getArea=function(){var e=this.points;var b=e.length;var h=new Array();var c=new Array();var f=0;var g=Math.floor((e[0].getX()+180)/6)+1;for(var d=0;d<b;d++){LatLonToUTMXY(DegToRad(e[d].getY()),DegToRad(e[d].getX()),g,c);h[d]=new DMCPoint(c[0],c[1],true)}for(var d=0;d<b-1;d++){f+=h[d].getX()*h[d+1].getY()-h[d].getY()*h[d+1].getX()}delete h;delete c;return Math.abs(0.5*f)};this.getAreaForInput=function(c){if((typeof(c)=="undefined")||(c==null)){return 0}var d=c;var b=d.length;var e=0;for(var f=0;f<b-1;f++){e+=d[f].getX()*d[f+1].getY()-d[f].getY()*d[f+1].getX()}return Math.abs(0.5*e)};this.getCenter=function(){var c=this.getCentroid();if(c==null){return null}if(this.contains(c)){return c}var b=this.adjustCenter(this.points,c);return b};this.getAveragePosition=function(){if(this.points==null){return null}var b=this.points.length;if(b<2){return null}var c=0;var e=0;for(var d=0;d<b-1;d++){c+=this.points[d].getX();e+=this.points[d].getY()}return new DMCPoint(c/(b-1),e/(b-1),true)};this.getCentroid=function(){if(this.points==null){return null}if(this.points.length<2){return null}var c=1e-20;var k=this.getAreaForInput(this.points);if(k<c){var f=this.getAveragePosition();return f}var d=this.points.length-1;var o=this.points[0].getX();var n=this.points[0].getY();var r=this.points[0].getY();var h=this.points[0].getY();var t=this.points[0].getX();var j=this.points[0].getX();for(var b=0;b<=d;b++){if(this.points[b].getY()>r){r=this.points[b].getY()}else{if(this.points[b].getY()<h){h=this.points[b].getY()}}if(this.points[b].getX()>t){t=this.points[b].getX()}else{if(this.points[b].getX()<j){j=this.points[b].getX()}}this.points[b].setX(this.points[b].getX()-o);this.points[b].setY(this.points[b].getY()-n)}var s=0;var q=0;var e;for(var b=0;b<d;b++){e=(this.points[b].getX()*this.points[b+1].getY()-this.points[b+1].getX()*this.points[b].getY());s+=((this.points[b].getX()+this.points[b+1].getX())*e);q+=((this.points[b].getY()+this.points[b+1].getY())*e)}var p=(0.166666666666667)*(1/k);s*=p;q*=p;for(var b=0;b<=d;b++){this.points[b].setX(this.points[b].getX()+o);this.points[b].setY(this.points[b].getY()+n)}s+=o;q+=n;var g=new DMCPoint(s,q,true);if((s<j)||(s>t)||(q<h)||(q>r)){g=this.getAveragePosition()}return g};this.adjustCenter=function(v,c){if((typeof(c)=="undefined")||(c==null)){return null}if((typeof(v)=="undefined")||(v==null)){return new DMCPoint(c.getX(),c.getY(),true)}var q=1e-20;var E=v.length;if(E<4){return new DMCPoint(c.getX(),c.getY(),true)}var m=E-1;var A=-1e+20;var b=1e+20;for(var h=0;h<=m;h++){if(v[h].getY()>A){A=v[h].getY()}if(v[h].getY()<b){b=v[h].getY()}}var d=c.getX();var p=c.getY();var e=new Array();var n=new Array();var B=0;if((p>b+q)&&(p<A-q)){B=this.horizontalSegments(v,e,n,p,0)}else{return new DMCPoint(d,p,true)}var w=-1;var D=1e+20;var y=-1;for(var h=0;h<B;h++){var z=Math.abs(n[h]-d);if(z<D){D=z;y=n[h];w=h}}if(w>=0){var k=new DMCPoint(y,p,true);return k}var f=4;var r=new Array(f+f);var g=A-p;if(g<q){g=0}var C=b-p;if(C>-q){C=0}var o=g/f;var u=C/f;var s=o;var x=u;for(var h=0;h<f;h++){r[h+h]=p+x;r[h+h+1]=p+s;s+=o;x+=u}for(var h=0;h<f+f;h++){var B=0;if((r[h]>b+q)&&(r[h]<A-q)){B=this.horizontalSegments(v,e,n,r[h],0)}var w=-1;var D=1e+20;var y=-1;for(var t=0;t<B;t++){var z=Math.abs(n[t]-d);if(z<D){D=z;y=n[t];w=t}}if(w>=0){var k=new DMCPoint(y,r[h],true);return k}}return new DMCPoint(d,p,true)};this.getCenterForPlacement=function(F,I,b){if((typeof(F)=="undefined")||(F==null)){return null}if(I<0){I=0}if(b<0){b=0}var p=1e-20;var d=F.length;if(d<4){return null}var c=new DMCPolygon(F);var v=this.getAreaForInput(F);if(v<p){var C=c.getAveragePosition();return C}var B=d-1;var o=F[0].getY();var A=F[0].getY();var E=F[0].getX();var q=F[0].getX();for(var G=0;G<=B;G++){if(F[G].getY()>o){o=F[G].getY()}else{if(F[G].getY()<A){A=F[G].getY()}}if(F[G].getX()>E){E=F[G].getX()}else{if(F[G].getX()<q){q=F[G].getX()}}}var m=c.getCentroid();var r=m.getX();var L=m.getY();var w=1.5;var n=false;var s=new Array();var J=new Array();var M=0;if((L>A+b/2+p)&&(L<o-b/2-p)){M=this.horizontalSegments(F,s,J,L,b)}else{n=true}var O=false;var N=-1;var x=-1;for(var G=0;G<M;G++){if(s[G]>N){N=s[G];x=G}if(s[G]>w*I){r=J[G];n=true;break}}var y=-10000000000;var H=-10000000000;var D=L;if(x>=0){y=N;H=J[x]}var K=8;if(!n){if(N>w*I){r=J[x];O=true}else{var g=new Array(K+K);var e=o-L;if(e<p){e=0}var t=A-L;if(t>-p){t=0}var z=e/K;var u=t/K;var h=z;var P=u;for(var G=0;G<K;G++){g[G+G]=L+P;g[G+G+1]=L+h;h+=z;P+=u}for(var G=0;G<K+K;G++){var M=0;if((g[G]>A+b/2+p)&&(g[G]<o-b/2-p)){M=this.horizontalSegments(F,s,J,g[G],b)}var N=-1;var x=-1;for(var f=0;f<M;f++){if(s[f]>N){N=s[f];x=f}}if(N>w*I){r=J[x];L=g[G];O=true;break}if(N>y){y=N;H=J[x];D=g[G]}}if((!O)&&(y>I)){r=H;L=D}delete g}}else{O=true}delete s;delete J;var k=new DMCPoint(r,L,true);if((r<q)||(r>E)||(L<A)||(L>o)){k=c.getAveragePosition()}return k};this.horizontalSegments=function(n,d,l,b,c){var q=0;var t=n.length;if(t<2){return 0}var p=1e-08;var g=c;if(g<p){g=p}var k=new Array();var h=0;for(var j=0;j<t-1;j++){var f=n[j].getY();var m=n[j+1].getY();var e=false;if((Math.abs(f-b)<g)&&(Math.abs(m-b)<g)){delete k;return 0}if(f<(b+p)){if(m>b){e=true}}else{if(f>(b-p)){if(m<b){e=true}}}if(e==true){var r=n[j].getX();var s=n[j+1].getX();var o=r+((b-f)*(s-r)/(m-f));k[h]=o;h++}}if(h%2==1){alert("Odd number of intersections!!")}if(h>0){k.sort(sortNumber);q=0;for(var j=0;j<h-1;j=j+2){d[q]=k[j+1]-k[j];l[q]=(k[j+1]+k[j])/2;q++}}delete k;return q};this.intersects=function(b){if(b==null){throw new DMCException("DMCPolygon.intersects can not take a null parameter")}if(b.TYPE=="POINT"){return this.contains(b)}else{if(b.TYPE=="BOUNDS"){var c=this.getBounds();return b.intersects(c)}}throw new DMCException("Only Point in polygon is supported")};this.contains=function(h){if(h==null){throw new DMCException("DMCPolygon.intersects can not take a null parameter")}if(h.TYPE!="POINT"){throw new DMCException("DMCPolygon.intersects expects only point geometry")}var g=0;var f=0;var b=this.points.length;var e=b-1;for(f,e;f<b;e=f++){var d=h.getY();var c=h.getX();if((((this.points[f].getY()<=d)&&(d<this.points[e].getY()))||((this.points[e].getY()<=d)&&(d<this.points[f].getY())))&&(c<(this.points[e].getX()-this.points[f].getX())*(d-this.points[f].getY())/(this.points[e].getY()-this.points[f].getY())+this.points[f].getX())){g=!g}}return g};this.getVertexCount=function(){return this.points.length};this.getVertex=function(b){return this.points[b]};this.isClockWise=function(){if((this.points==null)||(this.points.length<4)){return false}var h=false;var b=this.points.length;var f=this.points[0].getY();var c=0;for(var g=1;g<b-1;g++){if(this.points[g].getY()<f){f=this.points[g].getY();c=g}}var e=this.points[(c+b-2)%(b-1)].getX();var d=this.points[(c+1)%(b-1)].getX();if(e>d){h=true}else{h=false}return h}}DMCPolygon.prototype=new DMCPoly();function DMCCircle(a,b){this.TYPE="CIRCLE";this.dmcMap=b;this.points=new Array();this.points[0]=new DMCPoint(a[0].getX(),a[0].getY(),true);this.points[1]=new DMCPoint(a[1].getX(),a[1].getY(),true);this.getVertexCount=function(){return this.points.length};this.getVertex=function(c){return this.points[c]};this.calculatePolygon=function(){if(this.points==null||this.points.length<1){return null}var r=false;if(this.points[0].getLat()<0){r=true}var q=Math.floor((this.points[0].getX()+180)/6)+1;var k=new Array();var m=null;if(this.dmcMap!=null){m=new Array();m[0]=new DMCPoint(this.points[0].getX(),this.points[0].getY(),true);m[1]=new DMCPoint(this.points[1].getX(),this.points[1].getY(),true);for(var n=0;n<2;n++){var t=new Array();LatLonToUTMXY(DegToRad(m[n].getY()),DegToRad(m[n].getX()),q,t);m[n].setX(t[0]);m[n].setY(t[1])}}else{m=this.points}var l=100;var e=(Math.PI*2)/l;var k=new Array(l+1);var g=m[1].x-m[0].x;var o=m[1].y-m[0].y;var s=Math.sqrt(g*g+o*o);var p=m[0];var j=(m[1].getY()-m[0].getY())/s;var d=(m[1].getX()-m[0].getX())/s;k[0]=new DMCPoint(s,0,true);k[l]=new DMCPoint(s,0,true);var u=0;for(var n=1;n<l;n++){u+=e;var v=s*Math.cos(u);var c=s*Math.sin(u);k[n]=new DMCPoint(v,c,true)}for(var n=0;n<=l;n++){var v=k[n].getX()*d-k[n].getY()*j;var c=k[n].getY()*d+k[n].getX()*j;k[n].setX(p.x+v);k[n].setY(p.y+c)}if(this.dmcMap!=null){for(var n=0;n<=l;n++){var h=new Array();UTMXYToLatLon(k[n].getX(),k[n].getY(),q,r,h);k[n].setX(RadToDeg(h[1]));k[n].setY(RadToDeg(h[0]))}}var f=new DMCPolygon(k);return f};this.polygon=this.calculatePolygon();this.getCenter=function(){return new DMCPoint(this.points[0].getX(),this.points[0].getY(),true)};this.intersects=function(c){if(c==null){throw new DMCException("DMCCircle.intersects can not take a null parameter")}if(c.TYPE=="POINT"){return this.contains(c)}else{if(c.TYPE=="BOUNDS"){var d=this.getBounds();return c.intersects(d)}}throw new DMCException("Only Point in circle is supported")};this.contains=function(j){if(j==null){throw new DMCException("DMCCircle.intersects can not take a null parameter")}if(j.TYPE!="POINT"){throw new DMCException("DMCPolygon.intersects expects only point geometry")}if(this.points==null||this.points.length<1){return false}var n=null;var e=j;if(this.dmcMap!=null){n=new Array();n[0]=new DMCPoint(this.points[0].getX(),this.points[0].getY(),true);n[1]=new DMCPoint(this.points[1].getX(),this.points[1].getY(),true);n[2]=new DMCPoint(j.getX(),j.getY(),true);for(var c=0;c<3;c++){var l=Math.floor((n[c].getX()+180)/6)+1;var m=new Array();LatLonToUTMXY(DegToRad(n[c].getY()),DegToRad(n[c].getX()),l,m);n[c].setX(m[0]);n[c].setY(m[1])}e=n[2]}else{n=this.points}var h=n[1].getX()-n[0].getX();var o=n[1].getY()-n[0].getY();var d=h*h+o*o;var k=e.getX()-n[0].getX();var f=e.getY()-n[0].getY();var g=k*k+f*f;if(g<=d){return true}else{return false}};this.getPoints=function(){return this.points};this.clearBoundPoly=function(){this.polygon=null};this.getBoundPoly=function(){if(this.polygon==null){this.polygon=this.calculatePolygon()}return this.polygon};this.getBounds=function(){if(this.points==null||this.points.length!=2){throw new DMCException("DMCCircle: do not get bounds of an empty circle!")}var e=false;if(this.points[0].getLat()<0){e=true}var k=Math.floor((this.points[0].getX()+180)/6)+1;var m=null;if(this.dmcMap!=null){m=new Array();m[0]=new DMCPoint(this.points[0].getX(),this.points[0].getY(),true);m[1]=new DMCPoint(this.points[1].getX(),this.points[1].getY(),true);for(var c=0;c<2;c++){var l=new Array();LatLonToUTMXY(DegToRad(m[c].getY()),DegToRad(m[c].getX()),k,l);m[c].setX(l[0]);m[c].setY(l[1])}}else{m=this.points}var h=m[1].x-m[0].x;var n=m[1].y-m[0].y;var j=Math.sqrt(h*h+n*n);var f=new Array();f[0]=new DMCPoint(m[0].x+j,m[0].y,true);f[1]=new DMCPoint(m[0].x,m[0].y+j,true);f[2]=new DMCPoint(m[0].x-j,m[0].y,true);f[3]=new DMCPoint(m[0].x,m[0].y-j,true);if(this.dmcMap!=null){for(var c=0;c<4;c++){var d=new Array();UTMXYToLatLon(f[c].getX(),f[c].getY(),k,e,d);f[c].setX(RadToDeg(d[1]));f[c].setY(RadToDeg(d[0]))}}var g=new DMCBounds(f);return g};this.getBoundsInPixel=function(){if(this.points==null||this.points.length!=2){throw new DMCException("DMCCircle: do not get bounds of an empty circle!")}var e=false;if(this.points[0].getLat()<0){e=true}var k=Math.floor((this.points[0].getX()+180)/6)+1;var m=null;if(this.dmcMap!=null){m=new Array();m[0]=new DMCPoint(this.points[0].getX(),this.points[0].getY(),true);m[1]=new DMCPoint(this.points[1].getX(),this.points[1].getY(),true);for(var c=0;c<2;c++){var l=new Array();LatLonToUTMXY(DegToRad(m[c].getY()),DegToRad(m[c].getX()),k,l);m[c].setX(l[0]);m[c].setY(l[1])}}else{m=this.points}var h=m[1].x-m[0].x;var n=m[1].y-m[0].y;var j=Math.sqrt(h*h+n*n);var f=new Array();f[0]=new DMCPoint(m[0].x+j,m[0].y,true);f[1]=new DMCPoint(m[0].x,m[0].y+j,true);f[2]=new DMCPoint(m[0].x-j,m[0].y,true);f[3]=new DMCPoint(m[0].x,m[0].y-j,true);if(this.dmcMap!=null){for(var c=0;c<4;c++){var d=new Array();UTMXYToLatLon(f[c].getX(),f[c].getY(),k,e,d);f[c].setX(RadToDeg(d[1]));f[c].setY(RadToDeg(d[0]))}this.dmcMap.latLngPointsToPixelPoints(f)}var g=new DMCBounds(f);return g};this.getArea=function(){if(this.points==null||this.points.length!=2){return 0}var l=this.points;var d=l.length;var k=new Array();var j=new Array();var e=0;var h=Math.floor((l[0].getX()+180)/6)+1;for(var c=0;c<d;c++){LatLonToUTMXY(DegToRad(l[c].getY()),DegToRad(l[c].getX()),h,j);k[c]=new DMCPoint(j[0],j[1],true)}var g=k[1].getX()-k[0].getX();var f=k[1].getY()-k[0].getY();var e=Math.PI*(g*g+f*f);delete k;delete j;return e};this.getLength=function(){if(this.points==null||this.points.length!=2){return 0}var m=this.points;var d=m.length;var l=new Array();var k=new Array();var e=0;var j=Math.floor((m[0].getX()+180)/6)+1;for(var c=0;c<d;c++){LatLonToUTMXY(DegToRad(m[c].getY()),DegToRad(m[c].getX()),j,k);l[c]=new DMCPoint(k[0],k[1],true)}var g=l[1].getX()-l[0].getX();var f=l[1].getY()-l[0].getY();var h=2*Math.PI*Math.sqrt(g*g+f*f);delete l;delete k;return h};this.getCentroid=function(){return new DMCPoint(this.points[0].getX(),this.points[0].getY())};this.toString=function(){if(this.points==null||this.points.length<2){return""}var c="CIRCLE(("+this.points[0].x+" "+this.points[0].y+","+this.points[1].x+" "+this.points[1].y+"))";return c}}function WKT(c){try{var h=new RegExp(/(?:\()([^)(]*)(?:\))/g);var a=h.exec(c);var f=null;if(a!=null&&a.length>0){f=a[0].substring(1,a[0].length-1)}h=new RegExp(/[^(]*/g);var j=h.exec(c);var g=null;if(j!=null&&j.length>0){g=j[0].replace(/ /,"")}if(f==null||f==""||g==null||g==""){return null}var b=__parseWKTPointsString(f);if(g=="POINT"){if(b.length!=2){throw null}return new DMCPoint(b[0],b[1])}else{if(g=="LINESTRING"){if(b.length<4){throw null}return new DMCLineString(_pointArray1DtoPointArray(b))}else{if(g=="POLYGON"||g=="MULTIPOLYGON"){if(b.length<4){throw null}return new DMCPolygon(_pointArray1DtoPointArray(b))}else{if(g=="CIRCLE"){if(b.length<2){throw null}return new DMCCircle(_pointArray1DtoPointArray(b))}else{return null}}}}}catch(d){return null}}function __parseWKTPointsString(d){var e=d.split(",");var a=[];for(var b=0;b<e.length;b++){var c=e[b].split(" ");c=__deleteBlankStringFromArray(c);if(c.length!=2){throw"unsupported/malformatted wkt format:"+d}a.push(parseFloat(c[0]));a.push(parseFloat(c[1]))}return a}function __deleteBlankStringFromArray(f){var e=[];for(var c=0;c<f.length;c++){var d=true;var b=f[c].split(" ");for(var a=0;a<b.length;a++){if(b[a].length!=0){d=false;break}}if(!d){e.push(_trim(f[c]))}}return e}function _lTrim(a){return a.replace(/^\s*/,"")}function _rTrim(a){return a.replace(/\s*$/,"")}function _trim(a){return _rTrim(_lTrim(a))}function _getLength(h){var f=0;var b=h.length;var d=new Array();var g=new Array();var e=Math.floor((h[0].getX()+180)/6)+1;for(var a=0;a<b;a++){LatLonToUTMXY(DegToRad(h[a].getY()),DegToRad(h[a].getX()),e,d);g[a]=new DMCPoint(d[0],d[1],true)}for(var a=0;a<b-1;a++){var c=Math.pow((g[a].getX()-g[a+1].getX()),2)+Math.pow((g[a].getY()-g[a+1].getY()),2);f=f+Math.sqrt(c)}return f}function createPolygonFromEnvelope(a,b,c,d){var e=[new DMCPoint(a,b),new DMCPoint(c,b),new DMCPoint(c,d),new DMCPoint(a,d),new DMCPoint(a,b)];var f=new DMCPolygon(e);return f}function distanceBetweenLatLongs(h,f){var g=6372795.477598;var a=b(h);var d=b(f);var c=a.dot(d);var e=Math.acos(c);return g*e;function b(p){var n=p.getLatRadians();var l=p.getLngRadians();var m=Math.sin(n);var o=Math.cos(n);var j=o*Math.cos(l);var k=o*Math.sin(l);return new DMCPoint3D(j,k,m)}}Dmp.Geometry.distance=function(d,b){var e=d.x-b.x;var c=d.y-b.y;var a=Math.sqrt(e*e+c*c);return a};if(typeof(distance)=="undefined"){distance=Dmp.Geometry.distance}function sortNumber(c,d){return(c-d)}function pointCloseToSegment(g,k,l,h){var c=k.getX()-g.getX();var f=k.getY()-g.getY();var d=Math.sqrt(c*c+f*f);var e=l.getX()-g.getX();var n=l.getY()-g.getY();var j=e*e+n*n;if(d<Math.EPSILON){if(j<h*h){return true}else{return false}}else{var m=(c*e+f*n)/d;var b=j-m*m;if((m>=-h)&&(m<=d+h)&&(b<h*h)){return true}else{return false}}}function DMCtoGoogGeometry(a,b,l,j,d,k){if(!a.TYPE){throw new DMCException("DMCtoGoogGeometry: input is not a DMC javascript geometry")}try{var h=a.getPoints();var f=[];for(var g=0;g<h.length;g++){f.push(new GLatLng(h[g].getY(),h[g].getX()))}if(a.TYPE=="POINT"){return f[0]}else{if(a.TYPE=="BOUNDS"||a.TYPE=="POLYGON"){return new GPolygon(f,b,l,j,d,k)}else{if(a.TYPE.indexOf("LINE")>=0){return new GPolyline(f,b,l,j)}}}}catch(c){}throw new DMCException("DMCtoGoogGeometry: input is an not a DMC javascript geometry ("+a.TYPE+")")}function FixForFirefox2(){var c=0;var b="Firefox/";var a=navigator.userAgent.indexOf(b);if(a!=-1){c=parseFloat(navigator.userAgent.substring(a+b.length))}if(c>=1.5){Msn.Drawing.Graphic.CreateGraphic=function(e,d){return new Msn.Drawing.SVGGraphic(e,d)}}}function SetDMPKey(a){_DMP_KEY=a}var _G_COUNTER=0;var _DMP_KEY="user";var _OUTPUT_TYPE="PNG";var _G_DMP_SERVER_NAME="http://parcelstream.com";var G_NUM_SERVERS=4;var _G_MULTIDOMAIN_SERVER_NAME=new Array();for(var i=0;i<G_NUM_SERVERS;i++){_G_MULTIDOMAIN_SERVER_NAME[i]="t"+i}var _gExpectedFilter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='";function _gOverrideAppendChildIE7(e,d,b,a){if(e.tagName!="IMG"){return this._dmcAppendChild(e,d,b,a)}if(e.src.indexOf(_G_DMP_SERVER_NAME)<0&&!containsDomainName(e.src)){return this._dmcAppendChild(e,d,b,a)}var f=e.style.filter;if(f==null||f==""){return this._dmcAppendChild(e,d,b,a)}f+="";var c="alpha(opacity=100);";if(f.indexOf(c)>=0){e.style.filter=""}return this._dmcAppendChild(e,d,b,a)}function _gOverrideAppendChildIE6(e,l,a,j){if(e.tagName=="DIV"&&e.innerHTML==""){var d=e.style.filter;if(d!=null){d+="";if(d!=""){if(d.indexOf(_gExpectedFilter+_G_DMP_SERVER_NAME)>=0||containsDomainName(d,_gExpectedFilter,_gExpectedFilter.length)){var m=d.indexOf("http://");var b=d.indexOf("',",m);var f=d.substring(m,b);var h=false;if(f!=null&&f.toLowerCase().indexOf("png")>-1){h=true}if(h){var c=", alpha(opacity=100)";var g=""+e.style.filter;var k=g.split(c);if(k.length==2){e.style.filter=k[0]+k[1]}}else{var n=document.createElement("IMG");n.src=f;n.style.left=e.style.left;n.style.top=e.style.top;n.style.width=e.style.width;n.style.height=e.style.height;n.style.border=e.style.border;n.style.zIndex=e.style.zIndex;n.style.position=e.style.position;e=n}}}}}this._dmcAppendChild(e,l,a,j)}var _b_dmc_hasInitCalled=false;function gInitializeDMPLayers(b){if(_b_dmc_hasInitCalled){return}_b_dmc_hasInitCalled=true;if(document.all){var a=document.getElementById(b.ID).firstChild;if(a==null){alert("Error in DMP API. Please contact Digital Map Products Inc. Support.");return}a._dmcAppendChild=a.appendChild;if(navigator.userAgent.indexOf("MSIE 7.0")>=0){a.appendChild=_gOverrideAppendChildIE7}else{a.appendChild=_gOverrideAppendChildIE6}}}function SetParcelLayerVisibility(c,a){if(c==null){alert("Please pass Virtual Earth map instance as a parameter to the ToggleDMPParcelLayer() function. ");return}var b=c.parcelLayer;if(b){b.setVisible(a)}}function AddDMPParcelLayer(c,b){if(c==null){alert("Please pass Virtual Earth map instance as a parameter to the AddDMPParcelLayer() function. ");return}else{if(typeof(c.parcelLayer)!="undefined"){alert("This map already has a parcel layer defined in it. ");return}}gInitializeDMPLayers(c);var a=new TiledLayer(c,["Parcels"]);a.setMinZoomLevel(16);a.setMaxZoomLevel(19);a.setFormat("image/png");if(b){a.setZIndex(b)}a.initialize();c.parcelLayer=a}function containsDomainName(c,a,d){var b,f;if(a==null){a="";d=0}else{if(d==null||d<0){d=0}}for(var e=0;e<G_NUM_SERVERS;e++){f=_G_DMP_SERVER_NAME.substr(0,7)+_G_MULTIDOMAIN_SERVER_NAME[e]+"."+_G_DMP_SERVER_NAME.substr(7);if(d<a.length){b=a.substr(0,d)+f+a.substr(d)}else{b=a+f}if(c.toLowerCase().indexOf(b.toLowerCase())!=-1){return true}}return false}function GoogleTiledLayer(n,r,e){var h="http://t%2.parcelstream.com/";if(!e){e=h+"VEParcelTileServer.aspx"}var g=n;var q=null;var v=true;var f=r;var m=17;var k=19;var u=1;var a=new GCopyrightCollection();var t=false;var o=null;var s=null;var d=[];var w="image/png";var b="Layer"+new Date().getTime()+"_"+(_G_COUNTER++);this.setFormat=function(y){w=y;if(t){if(g!=null){l();x()}}};this.getFormat=function(){return w};this.addCopyright=function(y){a.addCopyright(y)};this.getCopyrights=function(y,z){return a.getCopyrights(y,z)};this.getProperty=function(y){return d[y]};this.setProperty=function(y,z){if(y!=null&&y!=""){d[y]=z}};this.getVisible=function(){return v};this.setMinZoomLevel=function(y){m=y};this.setMaxZoomLevel=function(y){k=y};this.getMinZoomLevel=function(){return m};this.getMaxZoomLevel=function(){return k};this.setOpacity=function(y){if(y!=null&&y>=0&&y<=1){u=y}if(t){if(g!=null){l();x()}}};this.getOpacity=function(){return u};this.setStyleLayerDescriptorUrl=function(y){o=y};this.getStyleLayerDescriptorUrl=function(){return o};this.setStyleLayerDescriptorText=function(y){s=y};this.getStyleLayerDescriptorText=function(){return s};this.setVisible=function(y){try{v=y;if(v){l();x()}else{q.hide()}}catch(z){}};this.initialize=function(){if(t){return}x();t=true};function x(){var y=new GTileLayer(a,m,k);y.getTileUrl=c;y.isPng=function(){if(w=="image/png"){return true}else{return false}};y.getOpacity=function(){return u};q=new GTileLayerOverlay(y);g.addOverlay(q)}function l(){if(g!=null){g.removeOverlay(q)}}function c(A,y){if(!v||y<m||y>k){return""}var B=e.replace("%2",""+Math.floor(Math.random()*G_NUM_SERVERS));var C=B+"?tileid="+p(A.x,A.y,y);if(f!=null&&f!=""&&f.length>0){C+="&layers="+j(f.join(","))}if(o!=null){C+="&SLD="+j(o)}if(w!=null){C+="&format="+encodeURIComponent(w)}if(s!=null){C+="&SLD_BODY="+j(s)}C+="&IsEncoded=true&SRS=EPSG:4326&REQUEST=MAP";for(var z in d){var D=d[z];if(D!=null&&D!=""){if(typeof(D)!=="undefined"&&typeof(D)!=="function"){C+=("&"+z+"="+encodeURIComponent(D))}}}return C}function p(A,B,E){var y="";for(var D=E;D>0;D--){var C="0";var z=1<<(D-1);if((A&z)!=0){C++}if((B&z)!=0){C++;C++}y+=C}return y}function j(y){return encodeURIComponent(y).replace(/%/g,"._-")}}function GoogleWMSLayer(f,q,d){var j=d;if(!j){j=_G_DMP_SERVER_NAME+"/VEParcelTileServer.aspx"}var g=f;var p=null;var u=true;var e=q;var a=17;var h=19;var s=false;var o=null;var r=null;var t=[];var l="image/png";var m="Layer"+new Date().getTime()+"_"+(_G_COUNTER++);this.setFormat=function(v){l=v};this.getFormat=function(){return l};this.getProperty=function(v){return t[v]};this.setProperty=function(v,w){if(v!=null&&v!=""){t[v]=w}if(s){this.onviewchange()}};this.setStyleLayerDescriptorUrl=function(v){o=v;if(s){this.onviewchange()}};this.getStyleLayerDescriptorUrl=function(){return o};this.setStyleLayerDescriptorText=function(v){r=v;if(s){this.onviewchange()}};this.getStyleLayerDescriptorText=function(){return r};this.getVisible=function(){return u};this.setMinZoomLevel=function(v){a=v;if(s){this.onviewchange()}};this.setMaxZoomLevel=function(v){h=v;if(s){this.onviewchange()}};this.getMinZoomLevel=function(){return a};this.getMaxZoomLevel=function(){return h};this.setVisible=function(v){u=v;try{if(u){this.onviewchange()}else{p.hide()}}catch(w){}};this.onviewchange=function(B){if(p){g.removeOverlay(p)}if(!b.getVisible()){return}var D=g.getZoom();if(a>D||h<D){return}var v=g.getBounds();var A=g.getSize();var E=v.getSouthWest();var C=v.getNorthEast();var F="?bbox="+E.lng()+","+E.lat()+","+C.lng()+","+C.lat();var z="";z+=j+F;var w=encodeURIComponent;if((n>=5.5)&&(n<7)&&(document.body.filters)&&(typeof(d)=="undefined"||d==null)&&l!=null&&l.toLowerCase().indexOf("png")>-1){w=k;z+="&IsEncoded=true"}z+="&width="+A.width;z+="&height="+A.height;if(e!=null&&e!=""&&e.length>0){z+="&layers="+w(e.join(","))}if(o!=null){z+="&SLD="+w(o)}if(l!=null){z+="&format="+w(l)}if(r!=null){z+="&SLD_BODY="+w(r)}z+="&SRS=EPSG:4326&REQUEST=MAP";for(var x in t){var y=t[x];if(y!=null&&y!=""){if(typeof(y)!=="undefined"&&typeof(y)!=="function"){z+=("&"+x+"="+w(y))}}}p=new GGroundOverlay(z,v);g.addOverlay(p)};var c=navigator.appVersion.split("MSIE");var n=parseFloat(c[1]);var b=this;this.initialize=function(){if(s){return}GEvent.bind(g,"moveend",b,b.onviewchange);b.onviewchange();s=true};function k(v){return encodeURIComponent(v).replace(/%/g,"._-")}}function TiledLayer(d,c,a){var b=null;if(typeof(GMap2)!="undefined"&&d instanceof GMap2){b=new GoogleTiledLayer(d,c,a);this.addCopyright=function(e){b.addCopyright(e)};this.getCopyrights=function(e,f){return b.getCopyrights(e,f)}}else{if(typeof(VEMap)!="undefined"&&d instanceof VEMap){b=new VETiledLayer(d,c,a);this.setZIndex=function(e){b.setZIndex(e)};this.getZIndex=function(){return b.getZIndex()}}else{return null}}this.setFormat=function(e){b.setFormat(e)};this.getFormat=function(){return b.getFormat()};this.setProperty=function(e,f){b.setProperty(e,f)};this.getProperty=function(e){return b.getProperty(e)};this.setVisible=function(e){b.setVisible(e)};this.getVisible=function(){return b.getVisible()};this.setMinZoomLevel=function(e){b.setMinZoomLevel(e)};this.getMinZoomLevel=function(){return b.getMinZoomLevel()};this.setMaxZoomLevel=function(e){b.setMaxZoomLevel(e)};this.getMaxZoomLevel=function(){return b.getMaxZoomLevel()};this.setOpacity=function(e){b.setOpacity(e)};this.getOpacity=function(){return b.getOpacity()};this.setStyleLayerDescriptorUrl=function(e){b.setStyleLayerDescriptorUrl(e)};this.getStyleLayerDescriptorUrl=function(){return b.getStyleLayerDescriptorUrl()};this.setStyleLayerDescriptorText=function(e){b.setStyleLayerDescriptorText(e)};this.getStyleLayerDescriptorText=function(){return b.getStyleLayerDescriptorText()};this.initialize=function(){b.initialize()};this.draw=function(){}}function VETiledLayer(u,p,e){gInitializeDMPLayers(u);var g="http://t%2.parcelstream.com/";if(!e){e=g+"VEParcelTileServer.aspx"}var t=true;var f=p;var a=17;var h=19;var b=1;var r=false;var c=100;var n=null;var q=null;var s=[];var k="image/png";var l="Layer"+new Date().getTime()+"_"+(_G_COUNTER++);this.setFormat=function(w){k=w};this.getFormat=function(){return k};this.setZIndex=function(w){c=w};this.getZIndex=function(){return c};this.getProperty=function(w){return s[w]};this.setProperty=function(w,x){if(w!=null&&w!=""){s[w]=x}};this.getVisible=function(){return t};this.setMinZoomLevel=function(w){a=w;if(r){if(u!=null){d();v()}}};this.setMaxZoomLevel=function(w){h=w;if(r){if(u!=null){d();v()}}};this.getMinZoomLevel=function(){return a};this.getMaxZoomLevel=function(){return h};this.setOpacity=function(w){if(w!=null&&w>=0&&w<=1){b=w}if(r){if(u!=null){d();v()}}};this.getOpacity=function(){return b};this.setStyleLayerDescriptorUrl=function(w){n=w;if(r){if(u!=null){d();v()}}};this.getStyleLayerDescriptorUrl=function(){return n};this.setStyleLayerDescriptorText=function(w){q=w;if(r){if(u!=null){d();v()}}};this.getStyleLayerDescriptorText=function(){return q};this.setVisible=function(w){try{t=w;if(this.getVisible()){if(o(u.ShowTileLayer)){u.ShowTileLayer(l)}else{if(o(u.ShowLayer)){d();v()}}}else{if(o(u.HideTileLayer)){u.HideTileLayer(l)}else{if(o(u.HideLayer)){d()}}}}catch(x){}};_this=this;this.initialize=function(){if(r){return}v();r=true};function v(){var y=m();var x=new VETileSourceSpecification(l,y);x.NumServers=G_NUM_SERVERS;x.MinZoomLevel=a;x.MaxZoomLevel=h;x.Opacity=b;x.ZIndex=c;if(o(u.AddTileLayer)){if(u!=null){u.AddTileLayer(x,true)}}else{if(o(u.AddLayer)){u.AddTileSource(x);var w=new VELayerSpecification(VELayerType.VETileSource,l,l);w.ZIndex=c;w.Opacity=b;u.AddLayer(w)}}}function d(){if(u!=null){try{if(o(u.DeleteTileLayer)){u.DeleteTileLayer(l)}else{if(o(u.DeleteLayer)&&o(u.DeleteTileSource)){u.DeleteLayer(l);u.DeleteTileSource(l)}}}catch(w){}}}function o(w){return(typeof(w)!="undefined"&&w!=null)}function m(){var y=e+"?tileid=%4";if(f!=null&&f!=""&&f.length>0){y+="&layers="+j(f.join(","))}if(n!=null){y+="&SLD="+j(n)}if(k!=null){y+="&format="+encodeURIComponent(k)}if(q!=null){y+="&SLD_BODY="+j(q)}y+="&IsEncoded=true&SRS=EPSG:4326&REQUEST=MAP";for(var x in s){var w=s[x];if(w!=null&&w!=""){if(typeof(w)!=="undefined"&&typeof(w)!=="function"){y+=("&"+x+"="+encodeURIComponent(w))}}}y+="&OverrideMapStyle="+j("<OverrideMapStyle><FORCE>1</FORCE></OverrideMapStyle>");return y}function j(w){return encodeURIComponent(w).replace(/%/g,"._-")}}function VEWMSLayer(w,r,f){gInitializeDMPLayers(w);var k=f;if(!k){k=_G_DMP_SERVER_NAME+"/VEParcelTileServer.aspx"}var l=null;var v=true;var g=r;var a=17;var j=19;var b=1;var t=false;var p=null;var s=null;var u=[];var c=2;var m="image/png";var n="Layer"+new Date().getTime()+"_"+(_G_COUNTER++);this.setFormat=function(x){m=x};this.getFormat=function(){return m};this.setZIndex=function(x){c=x};this.getZIndex=function(){return c};this.getProperty=function(x){return u[x]};this.setProperty=function(x,y){if(x!=null&&x!=""){u[x]=y}};this.setStyleLayerDescriptorUrl=function(x){p=x};this.getStyleLayerDescriptorUrl=function(){return p};this.setStyleLayerDescriptorText=function(x){s=x};this.getStyleLayerDescriptorText=function(){return s};this.getVisible=function(){return v};this.setMinZoomLevel=function(x){a=x};this.setMaxZoomLevel=function(x){j=x};this.getMinZoomLevel=function(){return a};this.getMaxZoomLevel=function(){return j};this.setOpacity=function(x){if(x!=null&&x>=0&&x<=1){b=x}};this.getOpacity=function(){return b};this.setVisible=function(z){try{v=z;if(this.getVisible()){this.onviewchange(null)}else{var A=q();var x=A.firstChild;if(l!=null){x.removeChild(l);l=null}}}catch(y){}};this.onviewchange=function(L){if(!_this.getVisible()){return}var B=q();var I=B.firstChild;if(l!=null){I.removeChild(l);l=null}var C=w.GetZoomLevel();if(a>C||j<C){return}var K=w.GetWidth();var A=w.GetHeight();var P=0;var z=0;var R=P+w.GetWidth();var y=z+w.GetHeight();var G=w.PixelToLatLong(new VEPixel(P,y));var Q=w.PixelToLatLong(new VEPixel(R,z));var D=G.Longitude;var H=G.Latitude;var F=Q.Longitude;var J=Q.Latitude;var M="";M+=k;M+="?bbox="+D+","+H+","+F+","+J;var E=encodeURIComponent;if((o>=5.5)&&(o<7)&&(document.body.filters)&&(typeof(f)=="undefined"||f==null)&&m!=null&&m.toLowerCase().indexOf("png")>-1){E=h;M+="&IsEncoded=true"}M+="&width="+K;M+="&height="+A;if(g!=null&&g!=""&&g.length>0){M+="&layers="+E(g.join(","))}if(p!=null){M+="&SLD="+E(p)}if(m!=null){M+="&format="+E(m)}if(s!=null){M+="&SLD_BODY="+E(s)}M+="&SRS=EPSG:4326&REQUEST=MAP";for(var N in u){var x=u[N];if(x!=null&&x!=""){if(typeof(x)!=="undefined"&&typeof(x)!=="function"){M+=("&"+N+"="+E(x))}}}l=document.createElement("IMG");l.setAttribute("id","MDE"+n);l.id="MDE"+n;I.appendChild(l);var O=0-parseInt(I.style.top);var S=0-parseInt(I.style.left);l.style.left=S+"px";l.style.top=O+"px";l.style.position="absolute";l.style.width=K+"px";l.style.height=A+"px";l.style.opacity=b;l.style.filter="alpha(opacity="+(b*100)+")";l.style.zIndex=c;l.setAttribute("src",M);if(m!=null&&m.toLowerCase().indexOf("png")>-1){l=d(l)}};var e=navigator.appVersion.split("MSIE");var o=parseFloat(e[1]);function d(D){if((o>=5.5)&&(o<7)&&(document.body.filters)){var x=D.id;var z=(D.id)?"id='"+D.id+"' ":"";var B=(D.className)?"class='"+D.className+"' ":"";var y=(D.title)?"title='"+D.title+"' ":"title='"+D.alt+"' ";var A="display:inline-block;"+D.style.cssText;var C="<span "+z+B+y+' style="width:'+D.width+"px; height:"+D.height+"px;"+A+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+D.src+"', sizingMethod='scale');\"></span>";D.outerHTML=C;return document.getElementById(x)}return D}function q(){return document.getElementById(w.ID)}_this=this;this.initialize=function(){if(t){return}w.AttachEvent("onchangeview",this.onviewchange);this.onviewchange();t=true};function h(x){return encodeURIComponent(x).replace(/%/g,"._-")}}function WMSLayer(d,c,a){var b=null;if(typeof(GMap2)!="undefined"&&d instanceof GMap2){b=new GoogleWMSLayer(d,c,a)}else{if(typeof(VEMap)!="undefined"&&d instanceof VEMap){b=new VEWMSLayer(d,c,a);this.setZIndex=function(e){b.setZIndex(e)};this.getZIndex=function(){return b.getZIndex()};this.setOpacity=function(e){b.setOpacity(e)};this.getOpacity=function(){return b.getOpacity()}}else{return null}}this.setFormat=function(e){b.setFormat(e)};this.getFormat=function(){return b.getFormat()};this.setProperty=function(e,f){b.setProperty(e,f)};this.getProperty=function(e){return b.getProperty(e)};this.setVisible=function(e){b.setVisible(e)};this.getVisible=function(){return b.getVisible()};this.setMinZoomLevel=function(e){b.setMinZoomLevel(e)};this.getMinZoomLevel=function(){return b.getMinZoomLevel()};this.setMaxZoomLevel=function(e){b.setMaxZoomLevel(e)};this.getMaxZoomLevel=function(){return b.getMaxZoomLevel()};this.setStyleLayerDescriptorUrl=function(e){b.setStyleLayerDescriptorUrl(e)};this.getStyleLayerDescriptorUrl=function(){return b.getStyleLayerDescriptorUrl()};this.setStyleLayerDescriptorText=function(e){b.setStyleLayerDescriptorText(e)};this.getStyleLayerDescriptorText=function(){return b.getStyleLayerDescriptorText()};this.initialize=function(){b.initialize()};this.draw=function(){};this.onviewchange=b.onviewchange};